aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2012-02-22 12:49:08 +0800
committerdinoex <dinoex@FreeBSD.org>2012-02-22 12:49:08 +0800
commit40a08effdc9616b236cd3b02a28f0590f2a50512 (patch)
tree5b4b9bb71414451b52abfe68034983115e2222b3 /net
parentb3e6e34dba0eb1f6ffb72cc89eae569cc0a68c50 (diff)
downloadfreebsd-ports-gnome-40a08effdc9616b236cd3b02a28f0590f2a50512.tar.gz
freebsd-ports-gnome-40a08effdc9616b236cd3b02a28f0590f2a50512.tar.zst
freebsd-ports-gnome-40a08effdc9616b236cd3b02a28f0590f2a50512.zip
- fix UDP checksums in odd sized packets
PR: 165355 Submitted by: Y.A. Obtained from: debian
Diffstat (limited to 'net')
-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