From 7d6850f7c618d8f13d7945dd0dcee98223be6459 Mon Sep 17 00:00:00 2001 From: Alexey Kodanev Date: Tue, 3 Apr 2018 15:00:07 +0300 Subject: ipv6: add a wrapper for ip6_dst_store() with flowi6 checks Move commonly used pattern of ip6_dst_store() usage to a separate function - ip6_sk_dst_store_flow(), which will check the addresses for equality using the flow information, before saving them. There is no functional changes in this patch. In addition, it will be used in the next patch, in ip6_sk_dst_lookup_flow(). Signed-off-by: Alexey Kodanev Signed-off-by: David S. Miller --- net/ipv6/datagram.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'net/ipv6/datagram.c') diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 88bc2ef7c7a8..a02ad100f0d7 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -106,14 +106,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) } } - ip6_dst_store(sk, dst, - ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ? - &sk->sk_v6_daddr : NULL, -#ifdef CONFIG_IPV6_SUBTREES - ipv6_addr_equal(&fl6.saddr, &np->saddr) ? - &np->saddr : -#endif - NULL); + ip6_sk_dst_store_flow(sk, dst, &fl6); out: fl6_sock_release(flowlabel); -- cgit v1.2.3-59-g8ed1b