aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ipv6.h')
-rw-r--r--include/linux/ipv6.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index bcba48a97868..faed1e357dd6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -47,6 +47,7 @@ struct ipv6_devconf {
47 __s32 disable_ipv6; 47 __s32 disable_ipv6;
48 __s32 accept_dad; 48 __s32 accept_dad;
49 __s32 force_tllao; 49 __s32 force_tllao;
50 __s32 ndisc_notify;
50 void *sysctl; 51 void *sysctl;
51}; 52};
52 53
@@ -66,6 +67,11 @@ static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
66 return (struct ipv6hdr *)skb_network_header(skb); 67 return (struct ipv6hdr *)skb_network_header(skb);
67} 68}
68 69
70static inline struct ipv6hdr *inner_ipv6_hdr(const struct sk_buff *skb)
71{
72 return (struct ipv6hdr *)skb_inner_network_header(skb);
73}
74
69static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) 75static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
70{ 76{
71 return (struct ipv6hdr *)skb_transport_header(skb); 77 return (struct ipv6hdr *)skb_transport_header(skb);
@@ -363,20 +369,22 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
363#define inet_v6_ipv6only(__sk) 0 369#define inet_v6_ipv6only(__sk) 0
364#endif /* IS_ENABLED(CONFIG_IPV6) */ 370#endif /* IS_ENABLED(CONFIG_IPV6) */
365 371
366#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 372#define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
367 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 373 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
368 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 374 ((__sk)->sk_family == AF_INET6) && \
369 ((__sk)->sk_family == AF_INET6) && \ 375 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
370 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 376 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
371 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 377 (!(__sk)->sk_bound_dev_if || \
372 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 378 ((__sk)->sk_bound_dev_if == (__dif))) && \
373 379 net_eq(sock_net(__sk), (__net)))
374#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ 380
375 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 381#define INET6_TW_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
376 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ 382 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
377 ((__sk)->sk_family == PF_INET6) && \ 383 ((__sk)->sk_family == AF_INET6) && \
378 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ 384 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr)) && \
379 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ 385 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr)) && \
380 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 386 (!(__sk)->sk_bound_dev_if || \
387 ((__sk)->sk_bound_dev_if == (__dif))) && \
388 net_eq(sock_net(__sk), (__net)))
381 389
382#endif /* _IPV6_H */ 390#endif /* _IPV6_H */