diff options
author | tuexen <tuexen@FreeBSD.org> | 2014-09-28 17:22:45 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2014-09-28 17:22:45 +0000 |
commit | 186c8f6391d391337988bf0d7b6fe018374ed8a6 (patch) | |
tree | be9780a574763c03277ca53fa8340efcae261d6a | |
parent | aab771d81275210e947cce80bbc0529e88b67337 (diff) | |
download | FreeBSD-src-186c8f6391d391337988bf0d7b6fe018374ed8a6.zip FreeBSD-src-186c8f6391d391337988bf0d7b6fe018374ed8a6.tar.gz |
Checksum coverage values larger than 65535 for UDPLite are invalid.
Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV.
Reviewed by: kevlo
MFC after: 3 days
-rw-r--r-- | sys/netinet/udp_usrreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 584f390..b50783f 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1017,7 +1017,7 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) INP_WLOCK(inp); up = intoudpcb(inp); KASSERT(up != NULL, ("%s: up == NULL", __func__)); - if (optval != 0 && optval < 8) { + if ((optval != 0 && optval < 8) || (optval > 65535)) { INP_WUNLOCK(inp); error = EINVAL; break; |