Correct the returned UDP datagram length. See the PR for a more comprehensive

description of the fix.

PR:		misc/25503
Submitted by:	Jim Browne <jbrowne@jbrowne.com>
MFC after:	1 week
This commit is contained in:
Mike Smith 2001-05-28 22:27:06 +00:00
parent dc46262eaa
commit a5af32a054
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77370

View File

@ -267,6 +267,7 @@ readudp(d, pkt, len, tleft)
return -1;
}
n -= sizeof(*ip) + sizeof(*uh);
n = (n > (ntohs(uh->uh_ulen) - sizeof(*uh))) ?
ntohs(uh->uh_ulen) - sizeof(*uh) : n;
return (n);
}