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

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

ipv4: In ip_build_and_send_pkt() use 'saddr' and 'daddr' args passed in.



Instead of rt->rt_{dst,src}

The only tricky part is source route option handling.

If the source route option is enabled we can't just use plain 'daddr',
we have to use opt->opt.faddr.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69458cb1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -158,8 +158,8 @@ int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
	else
		iph->frag_off = 0;
	iph->ttl      = ip_select_ttl(inet, &rt->dst);
	iph->daddr    = rt->rt_dst;
	iph->saddr    = rt->rt_src;
	iph->daddr    = (opt && opt->opt.srr ? opt->opt.faddr : daddr);
	iph->saddr    = saddr;
	iph->protocol = sk->sk_protocol;
	ip_select_ident(iph, &rt->dst, sk);