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

View File

@ -1017,7 +1017,7 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt)
INP_WLOCK(inp); INP_WLOCK(inp);
up = intoudpcb(inp); up = intoudpcb(inp);
KASSERT(up != NULL, ("%s: up == NULL", __func__)); KASSERT(up != NULL, ("%s: up == NULL", __func__));
if (optval != 0 && optval < 8) { if ((optval != 0 && optval < 8) || (optval > 65535)) {
INP_WUNLOCK(inp); INP_WUNLOCK(inp);
error = EINVAL; error = EINVAL;
break; break;