summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2014-09-28 17:22:45 +0000
committertuexen <tuexen@FreeBSD.org>2014-09-28 17:22:45 +0000
commit186c8f6391d391337988bf0d7b6fe018374ed8a6 (patch)
treebe9780a574763c03277ca53fa8340efcae261d6a /sys/netinet/udp_usrreq.c
parentaab771d81275210e947cce80bbc0529e88b67337 (diff)
downloadFreeBSD-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
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c2
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;
OpenPOWER on IntegriCloud