From c9b0d15f8222de7854a6ad504c4562004b99e487 Mon Sep 17 00:00:00 2001 From: Masahide NAKAMURA Date: Mon, 3 Sep 2007 19:31:32 +0900 Subject: [PATCH] [IPV6] XFRM: Fix dependency issue at inet6_csk_xmit. Signed-off-by: Masahide NAKAMURA --- include/net/ip6_fib.h | 2 ++ net/ipv6/inet6_connection_sock.c | 31 ++++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 85d6d9f..8578213 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -106,7 +106,9 @@ struct rt6_info u8 rt6i_protocol; +#ifdef CONFIG_XFRM u32 rt6i_flow_cache_genid; +#endif }; static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index f389322..25b9317 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c @@ -143,29 +143,34 @@ static inline void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst, struct in6_addr *daddr, struct in6_addr *saddr) { - struct rt6_info *rt = (struct rt6_info *)dst; - __ip6_dst_store(sk, dst, daddr, saddr); - rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid); + +#ifdef CONFIG_XFRM + if (dst) { + struct rt6_info *rt = (struct rt6_info *)dst; + rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid); + } +#endif } static inline struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst; - struct rt6_info *rt; dst = __sk_dst_check(sk, cookie); - if (!dst) - goto end; - - rt = (struct rt6_info *)dst; - if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) { - sk->sk_dst_cache = NULL; - dst_release(dst); - dst = NULL; + +#ifdef CONFIG_XFRM + if (dst) { + struct rt6_info *rt = (struct rt6_info *)dst; + if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) { + sk->sk_dst_cache = NULL; + dst_release(dst); + dst = NULL; + } } - end: +#endif + return dst; } -- 1.4.4.2