]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: ip6_redirect() - use new style struct initializer instead of memset
authorMaciej Żenczykowski <maze@google.com>
Sun, 30 Sep 2018 06:44:48 +0000 (23:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 23:12:39 +0000 (16:12 -0700)
(allows for better compiler optimization)

Signed-off-by: Maciej Żenczykowski <maze@google.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index d28f83e0159339e4a18e539ede86186da90fad2c..6f252fa914c23304a2d65098302a929be63f1b25 100644 (file)
@@ -2508,16 +2508,15 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark,
 {
        const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
        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 = iph->daddr;
-       fl6.saddr = iph->saddr;
-       fl6.flowlabel = ip6_flowinfo(iph);
-       fl6.flowi6_uid = uid;
+       struct flowi6 fl6 = {
+               .flowi6_iif = LOOPBACK_IFINDEX,
+               .flowi6_oif = oif,
+               .flowi6_mark = mark,
+               .daddr = iph->daddr,
+               .saddr = iph->saddr,
+               .flowlabel = ip6_flowinfo(iph),
+               .flowi6_uid = uid,
+       };
 
        dst = ip6_route_redirect(net, &fl6, skb, &ipv6_hdr(skb)->saddr);
        rt6_do_redirect(dst, NULL, skb);