diff options
-rw-r--r-- | net/libnet/Makefile | 2 | ||||
-rw-r--r-- | net/libnet/files/patch-libnet_checksum.c | 23 |
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 |