Skip to contentSkip to conversation

ipv4: Fetch route saddr from flow key in ip4_datagram_connect().

PATCH New David Miller 1 participant 1 message Apr 29, 2011

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 3/10 ipv4: Fetch route saddr from flow key in ip4_datagram_connect().

Now that output route lookups update the flow with source address selection, we can fetch it from fl4->saddr instead of rt->rt_src

---
 net/ipv4/datagram.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/datagram.c +2 -2
index 216ba23..b7f583c 100644
@@ -63,9 +63,9 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 		return -EACCES;
 	}
 	if (!inet->inet_saddr)
-		inet->inet_saddr = rt->rt_src;	/* Update source address */
+		inet->inet_saddr = fl4.saddr;	/* Update source address */
 	if (!inet->inet_rcv_saddr) {
-		inet->inet_rcv_saddr = rt->rt_src;
+		inet->inet_rcv_saddr = fl4.saddr;
 		if (sk->sk_prot->rehash)
 			sk->sk_prot->rehash(sk);
 	}
Signature · 1 line
1.7.4.5