Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit def57687 authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Elide use of rt->rt_dst in ip_forward()



No matter what kind of header mangling occurs due to IP options
processing, rt->rt_dst will always equal iph->daddr in the packet.

So we can safely use iph->daddr instead of rt->rt_dst here.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c30883bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ int ip_forward(struct sk_buff *skb)

	rt = skb_rtable(skb);

	if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
	if (opt->is_strictroute && iph->daddr != rt->rt_gateway)
		goto sr_failed;

	if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&