[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180927230017.15398-6-zenczykowski@gmail.com>
Date: Thu, 27 Sep 2018 16:00:12 -0700
From: "Maciej Żenczykowski" <zenczykowski@...il.com>
To: "Maciej Żenczykowski" <maze@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: [PATCH 06/11] net: ip6_redirect_no_header() - use new style struct
initializer instead of memset
From: Maciej Żenczykowski <maze@...gle.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
---
net/ipv6/route.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e148d197d628..dd8c04f253d5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2526,15 +2526,14 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
const struct ipv6hdr *iph = ipv6_hdr(skb);
const struct rd_msg *msg = (struct rd_msg *)icmp6_hdr(skb);
struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_iif = LOOPBACK_IFINDEX;
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.daddr = msg->dest;
- fl6.saddr = iph->daddr;
- fl6.flowi6_uid = sock_net_uid(net, NULL);
+ struct flowi6 fl6 = {
+ .flowi6_iif = LOOPBACK_IFINDEX,
+ .flowi6_oif = oif,
+ .flowi6_mark = mark,
+ .daddr = msg->dest,
+ .saddr = iph->daddr,
+ .flowi6_uid = sock_net_uid(net, NULL),
+ };
dst = ip6_route_redirect(net, &fl6, skb, &iph->saddr);
rt6_do_redirect(dst, NULL, skb);
--
2.19.0.605.g01d371f741-goog
Powered by blists - more mailing lists