aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:15:40 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:37 -0500
commitca304b6104ffdd120bb6687a88a0625e58bc71cd (patch)
tree99bdf631af245808459a0a956350b9388eada7fc /include
parent8129765ac07c2455c927051e3a8b048b619b56ee (diff)
[IPV6]: Introduce inet6_rsk()
And inet6_rsk_offset in inet_request_sock, for the same reasons as inet_sock's pinfo6 member. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ip.h4
-rw-r--r--include/linux/ipv6.h39
2 files changed, 37 insertions, 6 deletions
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 33e8a19a1a0f..5a560daeade5 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -110,6 +110,10 @@ struct ip_options {
110 110
111struct inet_request_sock { 111struct inet_request_sock {
112 struct request_sock req; 112 struct request_sock req;
113#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
114 u16 inet6_rsk_offset;
115 /* 2 bytes hole, try to pack */
116#endif
113 u32 loc_addr; 117 u32 loc_addr;
114 u32 rmt_addr; 118 u32 rmt_addr;
115 u16 rmt_port; 119 u16 rmt_port;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e0b922785d98..7d3e86d9576e 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -199,18 +199,17 @@ static inline int inet6_iif(const struct sk_buff *skb)
199 return IP6CB(skb)->iif; 199 return IP6CB(skb)->iif;
200} 200}
201 201
202struct tcp6_request_sock { 202struct inet6_request_sock {
203 struct tcp_request_sock req;
204 struct in6_addr loc_addr; 203 struct in6_addr loc_addr;
205 struct in6_addr rmt_addr; 204 struct in6_addr rmt_addr;
206 struct sk_buff *pktopts; 205 struct sk_buff *pktopts;
207 int iif; 206 int iif;
208}; 207};
209 208
210static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) 209struct tcp6_request_sock {
211{ 210 struct tcp_request_sock tcp6rsk_tcp;
212 return (struct tcp6_request_sock *)sk; 211 struct inet6_request_sock tcp6rsk_inet6;
213} 212};
214 213
215/** 214/**
216 * struct ipv6_pinfo - ipv6 private area 215 * struct ipv6_pinfo - ipv6 private area
@@ -304,6 +303,28 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
304 return inet_sk(__sk)->pinet6; 303 return inet_sk(__sk)->pinet6;
305} 304}
306 305
306static inline struct inet6_request_sock *
307 inet6_rsk(const struct request_sock *rsk)
308{
309 return (struct inet6_request_sock *)(((u8 *)rsk) +
310 inet_rsk(rsk)->inet6_rsk_offset);
311}
312
313static inline u32 inet6_rsk_offset(struct request_sock *rsk)
314{
315 return rsk->rsk_ops->obj_size - sizeof(struct inet6_request_sock);
316}
317
318static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops)
319{
320 struct request_sock *req = reqsk_alloc(ops);
321
322 if (req != NULL)
323 inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req);
324
325 return req;
326}
327
307static inline struct raw6_sock *raw6_sk(const struct sock *sk) 328static inline struct raw6_sock *raw6_sk(const struct sock *sk)
308{ 329{
309 return (struct raw6_sock *)sk; 330 return (struct raw6_sock *)sk;
@@ -361,6 +382,12 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
361 return NULL; 382 return NULL;
362} 383}
363 384
385static inline struct inet6_request_sock *
386 inet6_rsk(const struct request_sock *rsk)
387{
388 return NULL;
389}
390
364static inline struct raw6_sock *raw6_sk(const struct sock *sk) 391static inline struct raw6_sock *raw6_sk(const struct sock *sk)
365{ 392{
366 return NULL; 393 return NULL;