diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-30 14:20:40 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-30 14:20:40 +0000 |
commit | f88076368123d254e8086f1f6697f749ab290879 (patch) | |
tree | 2143bfe4d5b65a9444b791bd4e35d8908df4a797 /extra/libnet/libnet-1.1.2.1-fix-chksum.patch | |
parent | 677254a4e83d90613365d24f36e4e1ce43fa08e5 (diff) |
extra/libnet: new aport
Libnet is a high-level API (toolkit) allowing the application programmer
to construct and inject network packets.
http://www.packetfactory.net/libnet/
Diffstat (limited to 'extra/libnet/libnet-1.1.2.1-fix-chksum.patch')
-rw-r--r-- | extra/libnet/libnet-1.1.2.1-fix-chksum.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/extra/libnet/libnet-1.1.2.1-fix-chksum.patch b/extra/libnet/libnet-1.1.2.1-fix-chksum.patch new file mode 100644 index 00000000000..e6f9bbc6dd2 --- /dev/null +++ b/extra/libnet/libnet-1.1.2.1-fix-chksum.patch @@ -0,0 +1,27 @@ +Fix a bug in chksum calculation for odd sized UDP packets. + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284729 + +--- libnet-1.1.2.1/src/libnet_checksum.c ++++ libnet-1.1.2.1/src/libnet_checksum.c +@@ -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); |