aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mroute6.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-30 19:12:20 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-30 19:12:20 -0400
commitb7058842c940ad2c08dd829b21e5c92ebe3b8758 (patch)
tree5fe78d599fc345ca0bcd4b083b79095a54b2921b /include/linux/mroute6.h
parenteb1cf0f8f7a9e5a6d573d5bd72c015686a042db0 (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.h4
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)
134struct sock; 134struct sock;
135 135
136#ifdef CONFIG_IPV6_MROUTE 136#ifdef CONFIG_IPV6_MROUTE
137extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); 137extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int);
138extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 138extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
139extern int ip6_mr_input(struct sk_buff *skb); 139extern int ip6_mr_input(struct sk_buff *skb);
140extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); 140extern 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
144static inline 144static inline
145int ip6_mroute_setsockopt(struct sock *sock, 145int 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}