diff options
author | David S. Miller <davem@davemloft.net> | 2009-09-30 19:12:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-30 19:12:20 -0400 |
commit | b7058842c940ad2c08dd829b21e5c92ebe3b8758 (patch) | |
tree | 5fe78d599fc345ca0bcd4b083b79095a54b2921b /include/linux/mroute6.h | |
parent | eb1cf0f8f7a9e5a6d573d5bd72c015686a042db0 (diff) |
net: Make setsockopt() optlen be unsigned.
This provides safety against negative optlen at the type
level instead of depending upon (sometimes non-trivial)
checks against this sprinkled all over the the place, in
each and every implementation.
Based upon work done by Arjan van de Ven and feedback
from Linus Torvalds.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mroute6.h')
-rw-r--r-- | include/linux/mroute6.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 43dc97e32183..b191865a6ca3 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -134,7 +134,7 @@ static inline int ip6_mroute_opt(int opt) | |||
134 | struct sock; | 134 | struct sock; |
135 | 135 | ||
136 | #ifdef CONFIG_IPV6_MROUTE | 136 | #ifdef CONFIG_IPV6_MROUTE |
137 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); | 137 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); |
138 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 138 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
139 | extern int ip6_mr_input(struct sk_buff *skb); | 139 | extern int ip6_mr_input(struct sk_buff *skb); |
140 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | 140 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); |
@@ -143,7 +143,7 @@ extern void ip6_mr_cleanup(void); | |||
143 | #else | 143 | #else |
144 | static inline | 144 | static inline |
145 | int ip6_mroute_setsockopt(struct sock *sock, | 145 | int ip6_mroute_setsockopt(struct sock *sock, |
146 | int optname, char __user *optval, int optlen) | 146 | int optname, char __user *optval, unsigned int optlen) |
147 | { | 147 | { |
148 | return -ENOPROTOOPT; | 148 | return -ENOPROTOOPT; |
149 | } | 149 | } |