From 951fc9df9558ee5ae01cef7255b1a33078a7653c Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 31 Dec 2003 20:28:44 -0800 Subject: [NET]: Do type checking in {udp,inet6,raw6,inet}_sk(). --- include/linux/ipv6.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/linux/ipv6.h') 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) -- cgit v1.2.3