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
This commit is contained in:
Michael Tuexen 2014-09-28 17:22:45 +00:00
parent cbaac00901
commit 03f90784bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272263

View File

@ -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;