aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-11 05:39:24 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-11 05:39:24 -0400
commit48ee3569f31d91084dc694fef5517eb782428083 (patch)
tree2053125bfd441e410d030042e02c125b0e5d35ce /include
parent4715213d9cf40285492fff4092bb1fa8e982f632 (diff)
ipv6: Move ipv6 twsk accessors outside of CONFIG_IPV6 ifdefs.
Fixes build when ipv6 is disabled. Reported-by: Fengguang Wu <wfg@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipv6.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 8260ef779762..bc6c8fd8ed01 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -410,6 +410,22 @@ struct tcp6_sock {
410 410
411extern int inet6_sk_rebuild_header(struct sock *sk); 411extern int inet6_sk_rebuild_header(struct sock *sk);
412 412
413struct inet6_timewait_sock {
414 struct in6_addr tw_v6_daddr;
415 struct in6_addr tw_v6_rcv_saddr;
416};
417
418struct tcp6_timewait_sock {
419 struct tcp_timewait_sock tcp6tw_tcp;
420 struct inet6_timewait_sock tcp6tw_inet6;
421};
422
423static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
424{
425 return (struct inet6_timewait_sock *)(((u8 *)sk) +
426 inet_twsk(sk)->tw_ipv6_offset);
427}
428
413#if IS_ENABLED(CONFIG_IPV6) 429#if IS_ENABLED(CONFIG_IPV6)
414static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 430static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
415{ 431{
@@ -459,28 +475,12 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
459#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 475#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
460#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 476#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
461 477
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) 478static inline u16 inet6_tw_offset(const struct proto *prot)
473{ 479{
474 return prot->twsk_prot->twsk_obj_size - 480 return prot->twsk_prot->twsk_obj_size -
475 sizeof(struct inet6_timewait_sock); 481 sizeof(struct inet6_timewait_sock);
476} 482}
477 483
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) 484static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk)
485{ 485{
486 return likely(sk->sk_state != TCP_TIME_WAIT) ? 486 return likely(sk->sk_state != TCP_TIME_WAIT) ?