FreeBSD Bugzilla – Attachment 122221 Details for
Bug 165355
net/libnet: UDP checksums are bogus in odd sized packets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 471 bytes, created by
Yevgeniy Averin
on 2012-02-21 10:20:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Yevgeniy Averin
Created:
2012-02-21 10:20:09 UTC
Size:
471 bytes
patch
obsolete
>--- 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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 165355
: 122221