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.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 8260ef779762..879db26ec401 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -299,9 +299,9 @@ struct ipv6_pinfo {
299 struct in6_addr rcv_saddr; 299 struct in6_addr rcv_saddr;
300 struct in6_addr daddr; 300 struct in6_addr daddr;
301 struct in6_pktinfo sticky_pktinfo; 301 struct in6_pktinfo sticky_pktinfo;
302 struct in6_addr *daddr_cache; 302 const struct in6_addr *daddr_cache;
303#ifdef CONFIG_IPV6_SUBTREES 303#ifdef CONFIG_IPV6_SUBTREES
304 struct in6_addr *saddr_cache; 304 const struct in6_addr *saddr_cache;
305#endif 305#endif
306 306
307 __be32 flow_label; 307 __be32 flow_label;
@@ -369,6 +369,7 @@ struct ipv6_pinfo {
369 __u8 rcv_tclass; 369 __u8 rcv_tclass;
370 370
371 __u32 dst_cookie; 371 __u32 dst_cookie;
372 __u32 rx_dst_cookie;
372 373
373 struct ipv6_mc_socklist __rcu *ipv6_mc_list; 374 struct ipv6_mc_socklist __rcu *ipv6_mc_list;
374 struct ipv6_ac_socklist *ipv6_ac_list; 375 struct ipv6_ac_socklist *ipv6_ac_list;
@@ -410,6 +411,22 @@ struct tcp6_sock {
410 411
411extern int inet6_sk_rebuild_header(struct sock *sk); 412extern int inet6_sk_rebuild_header(struct sock *sk);
412 413
414struct inet6_timewait_sock {
415 struct in6_addr tw_v6_daddr;
416 struct in6_addr tw_v6_rcv_saddr;
417};
418
419struct tcp6_timewait_sock {
420 struct tcp_timewait_sock tcp6tw_tcp;
421 struct inet6_timewait_sock tcp6tw_inet6;
422};
423
424static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
425{
426 return (struct inet6_timewait_sock *)(((u8 *)sk) +
427 inet_twsk(sk)->tw_ipv6_offset);
428}
429
413#if IS_ENABLED(CONFIG_IPV6) 430#if IS_ENABLED(CONFIG_IPV6)
414static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 431static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
415{ 432{
@@ -459,28 +476,12 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
459#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 476#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
460#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 477#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
461 478
462struct inet6_timewait_sock {
463 struct in6_addr tw_v6_daddr;
464 struct in6_addr tw_v6_rcv_saddr;
465};
466
467struct tcp6_timewait_sock {
468 struct tcp_timewait_sock tcp6tw_tcp;
469 struct inet6_timewait_sock tcp6tw_inet6;
470};
471
472static inline u16 inet6_tw_offset(const struct proto *prot) 479static inline u16 inet6_tw_offset(const struct proto *prot)
473{ 480{
474 return prot->twsk_prot->twsk_obj_size - 481 return prot->twsk_prot->twsk_obj_size -
475 sizeof(struct inet6_timewait_sock); 482 sizeof(struct inet6_timewait_sock);
476} 483}
477 484
478static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
479{
480 return (struct inet6_timewait_sock *)(((u8 *)sk) +
481 inet_twsk(sk)->tw_ipv6_offset);
482}
483
484static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) 485static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk)
485{ 486{
486 return likely(sk->sk_state != TCP_TIME_WAIT) ? 487 return likely(sk->sk_state != TCP_TIME_WAIT) ?