diff options
| author | Ingo Molnar <mingo@elte.hu> | 2003-12-31 20:28:44 -0800 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2003-12-31 20:28:44 -0800 |
| commit | 951fc9df9558ee5ae01cef7255b1a33078a7653c (patch) | |
| tree | 6fd59e6039259b9a09dae74918c4ad908f5ebb2f /include | |
| parent | 12173d801dbbe1950befa35386f584c2841de6a6 (diff) | |
[NET]: Do type checking in {udp,inet6,raw6,inet}_sk().
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ip.h | 5 | ||||
| -rw-r--r-- | include/linux/ipv6.h | 11 | ||||
| -rw-r--r-- | include/linux/udp.h | 5 |
3 files changed, 17 insertions, 4 deletions
diff --git a/include/linux/ip.h b/include/linux/ip.h index 1adc75a76926..ab799b48b485 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -159,7 +159,10 @@ struct inet_sock { struct inet_opt inet; }; -#define inet_sk(__sk) (&((struct inet_sock *)__sk)->inet) +static inline struct inet_opt * inet_sk(const struct sock *__sk) +{ + return &((struct inet_sock *)__sk)->inet; +} #endif diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index da2e64899c95..7f5a5c4280f7 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -270,8 +270,15 @@ struct tcp6_sock { struct ipv6_pinfo inet6; }; -#define inet6_sk(__sk) ((struct raw6_sock *)__sk)->pinet6 -#define raw6_sk(__sk) (&((struct raw6_sock *)__sk)->raw6) +static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) +{ + return ((struct raw6_sock *)__sk)->pinet6; +} + +static inline struct raw6_opt * raw6_sk(const struct sock *__sk) +{ + return &((struct raw6_sock *)__sk)->raw6; +} #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) diff --git a/include/linux/udp.h b/include/linux/udp.h index 492b258c76c8..cecbccdc1835 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -60,7 +60,10 @@ struct udp_sock { struct udp_opt udp; }; -#define udp_sk(__sk) (&((struct udp_sock *)__sk)->udp) +static inline struct udp_opt * udp_sk(const struct sock *__sk) +{ + return &((struct udp_sock *)__sk)->udp; +} #endif |
