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/sctp | |
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/sctp')
-rw-r--r-- | include/net/sctp/structs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 42d00ced5eb8..6e5f0e0c7967 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -544,7 +544,7 @@ struct sctp_af { | |||
544 | int level, | 544 | int level, |
545 | int optname, | 545 | int optname, |
546 | char __user *optval, | 546 | char __user *optval, |
547 | int optlen); | 547 | unsigned int optlen); |
548 | int (*getsockopt) (struct sock *sk, | 548 | int (*getsockopt) (struct sock *sk, |
549 | int level, | 549 | int level, |
550 | int optname, | 550 | int optname, |
@@ -554,7 +554,7 @@ struct sctp_af { | |||
554 | int level, | 554 | int level, |
555 | int optname, | 555 | int optname, |
556 | char __user *optval, | 556 | char __user *optval, |
557 | int optlen); | 557 | unsigned int optlen); |
558 | int (*compat_getsockopt) (struct sock *sk, | 558 | int (*compat_getsockopt) (struct sock *sk, |
559 | int level, | 559 | int level, |
560 | int optname, | 560 | int optname, |