aboutsummaryrefslogtreecommitdiff
path: root/net/libnet
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2012-02-22 04:49:08 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2012-02-22 04:49:08 +0000
commit481254d60dfc7f2ea88049440d7108042315fac8 (patch)
tree560c9197b38a33856f47338c509665eb2f964fe9 /net/libnet
parentc44902c585b062305bd63cf451ca27b4f167374d (diff)
downloadports-481254d60dfc7f2ea88049440d7108042315fac8.tar.gz
ports-481254d60dfc7f2ea88049440d7108042315fac8.zip
- fix UDP checksums in odd sized packets
PR: 165355 Submitted by: Y.A. Obtained from: debian
Notes
Notes: svn path=/head/; revision=292029
Diffstat (limited to 'net/libnet')
-rw-r--r--net/libnet/Makefile2
-rw-r--r--net/libnet/files/patch-libnet_checksum.c23
2 files changed, 24 insertions, 1 deletions
diff --git a/net/libnet/Makefile b/net/libnet/Makefile
index 3fb658ff0e38..6e58775c05a2 100644
--- a/net/libnet/Makefile
+++ b/net/libnet/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libnet
PORTVERSION= 1.1.2.1
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= net
MASTER_SITES= http://www.packetfactory.net/libnet/dist/ \
diff --git a/net/libnet/files/patch-libnet_checksum.c b/net/libnet/files/patch-libnet_checksum.c
new file mode 100644
index 000000000000..49588209b3ad
--- /dev/null
+++ b/net/libnet/files/patch-libnet_checksum.c
@@ -0,0 +1,23 @@
+--- 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); \ No newline at end of file