ports/165355: libnet: UDP checksums are bogus in odd sized packets
Y.A.
nexther0 at gmail.com
Tue Feb 21 10:20:10 UTC 2012
>Number: 165355
>Category: ports
>Synopsis: libnet: UDP checksums are bogus in odd sized packets
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Feb 21 10:20:09 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Y.A.
>Release: FreeBSD 7.2 RELEASE-p6
>Organization:
>Environment:
FreeBSD noc.umc.com.ua 7.2-RELEASE-p6 FreeBSD 7.2-RELEASE-p6 #4: Tue Jan 19 09:36:13 EET 2010 root at noc:/usr/obj/usr/src/sys/NOC amd64
>Description:
UDP checksums are bogus in odd sized packets
full detail
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284729
>How-To-Repeat:
simply create odd length packet
>Fix:
find attached patch
Patch attached with submission follows:
--- src/libnet_checksum.c.orig Mon Mar 1 22:26:12 2004
+++ src/libnet_checksum.c Mon Aug 25 15:44:12 2008
@@ -42,8 +42,10 @@
libnet_in_cksum(u_int16_t *addr, int len)
{
int sum;
+ u_int16_t last_byte;
sum = 0;
+ last_byte = 0;
while (len > 1)
{
@@ -52,7 +54,8 @@
}
if (len == 1)
{
- sum += *(u_int16_t *)addr;
+ *(u_int8_t*)&last_byte = *(u_int8_t*)addr;
+ sum += last_byte;
}
return (sum);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list