Commit e351bb62 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by David S. Miller

net: ip_rt_get_source() - use new style struct initializer instead of memset

(allows for better compiler optimization)
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d793fb46
...@@ -1217,18 +1217,15 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt) ...@@ -1217,18 +1217,15 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt)
src = ip_hdr(skb)->saddr; src = ip_hdr(skb)->saddr;
else { else {
struct fib_result res; struct fib_result res;
struct flowi4 fl4; struct iphdr *iph = ip_hdr(skb);
struct iphdr *iph; struct flowi4 fl4 = {
.daddr = iph->daddr,
iph = ip_hdr(skb); .saddr = iph->saddr,
.flowi4_tos = RT_TOS(iph->tos),
memset(&fl4, 0, sizeof(fl4)); .flowi4_oif = rt->dst.dev->ifindex,
fl4.daddr = iph->daddr; .flowi4_iif = skb->dev->ifindex,
fl4.saddr = iph->saddr; .flowi4_mark = skb->mark,
fl4.flowi4_tos = RT_TOS(iph->tos); };
fl4.flowi4_oif = rt->dst.dev->ifindex;
fl4.flowi4_iif = skb->dev->ifindex;
fl4.flowi4_mark = skb->mark;
rcu_read_lock(); rcu_read_lock();
if (fib_lookup(dev_net(rt->dst.dev), &fl4, &res, 0) == 0) if (fib_lookup(dev_net(rt->dst.dev), &fl4, &res, 0) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment