diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-06 00:32:31 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 07:08:55 -0500 |
commit | 6a9fb9479f2672fa392711735de9e642395c9a14 (patch) | |
tree | 16a27c604b453ed896b5f276467a233e6b39e78a /include/linux/mroute.h | |
parent | 4e058063f49f53f6d75f707e36c82edee6d2e919 (diff) |
[IPV4]: Clean the ip_sockglue.c from some ugly ifdefs
The #idfed CONFIG_IP_MROUTE is sometimes places inside the if-s,
which looks completely bad. Similar ifdefs inside the functions
looks a bit better, but they are also not recommended to be used.
Provide an ifdef-ed ip_mroute_opt() helper to cleanup the code.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mroute.h')
-rw-r--r-- | include/linux/mroute.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 7da2cee8e13..35a8277ec1b 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -128,6 +128,18 @@ struct igmpmsg | |||
128 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
129 | #include <net/sock.h> | 129 | #include <net/sock.h> |
130 | 130 | ||
131 | #ifdef CONFIG_IP_MROUTE | ||
132 | static inline int ip_mroute_opt(int opt) | ||
133 | { | ||
134 | return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10); | ||
135 | } | ||
136 | #else | ||
137 | static inline int ip_mroute_opt(int opt) | ||
138 | { | ||
139 | return 0; | ||
140 | } | ||
141 | #endif | ||
142 | |||
131 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); | 143 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); |
132 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 144 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
133 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 145 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |