diff options
Diffstat (limited to 'include/linux/ipv6.h')
-rw-r--r-- | include/linux/ipv6.h | 39 |
1 files changed, 33 insertions, 6 deletions
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 | ||
202 | struct tcp6_request_sock { | 202 | struct 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 | ||
210 | static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) | 209 | struct 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 | ||
306 | static 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 | |||
313 | static inline u32 inet6_rsk_offset(struct request_sock *rsk) | ||
314 | { | ||
315 | return rsk->rsk_ops->obj_size - sizeof(struct inet6_request_sock); | ||
316 | } | ||
317 | |||
318 | static 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 | |||
307 | static inline struct raw6_sock *raw6_sk(const struct sock *sk) | 328 | static 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 | ||
385 | static inline struct inet6_request_sock * | ||
386 | inet6_rsk(const struct request_sock *rsk) | ||
387 | { | ||
388 | return NULL; | ||
389 | } | ||
390 | |||
364 | static inline struct raw6_sock *raw6_sk(const struct sock *sk) | 391 | static inline struct raw6_sock *raw6_sk(const struct sock *sk) |
365 | { | 392 | { |
366 | return NULL; | 393 | return NULL; |