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/net/ipv6.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/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index ad9a51130254..8c31d8a0c1fe 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -550,7 +550,7 @@ extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | |||
550 | extern int ipv6_setsockopt(struct sock *sk, int level, | 550 | extern int ipv6_setsockopt(struct sock *sk, int level, |
551 | int optname, | 551 | int optname, |
552 | char __user *optval, | 552 | char __user *optval, |
553 | int optlen); | 553 | unsigned int optlen); |
554 | extern int ipv6_getsockopt(struct sock *sk, int level, | 554 | extern int ipv6_getsockopt(struct sock *sk, int level, |
555 | int optname, | 555 | int optname, |
556 | char __user *optval, | 556 | char __user *optval, |
@@ -559,7 +559,7 @@ extern int compat_ipv6_setsockopt(struct sock *sk, | |||
559 | int level, | 559 | int level, |
560 | int optname, | 560 | int optname, |
561 | char __user *optval, | 561 | char __user *optval, |
562 | int optlen); | 562 | unsigned int optlen); |
563 | extern int compat_ipv6_getsockopt(struct sock *sk, | 563 | extern int compat_ipv6_getsockopt(struct sock *sk, |
564 | int level, | 564 | int level, |
565 | int optname, | 565 | int optname, |