When using the dnet command-line tool, the fragment offset should

be limited to 0xfff8 but the actual limit was 0x1fff.  Add a missing
shift to support fragments for big IP packets.
ok naddy
This commit is contained in:
bluhm 2011-09-18 08:32:56 +00:00
parent bdbf2e73fc
commit 5b971d028d
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.29 2011/09/16 11:13:38 espie Exp $
# $OpenBSD: Makefile,v 1.30 2011/09/18 08:32:56 bluhm Exp $
COMMENT-main= portable low-level networking library
COMMENT-python= python interface to libdnet
@ -7,7 +7,7 @@ MODPY_EGG_VERSION=1.12
DISTNAME= libdnet-${MODPY_EGG_VERSION}
PKGNAME-main= ${DISTNAME}
PKGNAME-python= py-${DISTNAME}
REVISION-main= 2
REVISION-main= 3
REVISION-python= 3
SHARED_LIBS= dnet 1.0

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-test_dnet_aton_c,v 1.1 2011/09/18 08:32:56 bluhm Exp $
http://code.google.com/p/libdnet/issues/detail?id=17
--- test/dnet/aton.c.orig Mon Oct 14 17:42:10 2002
+++ test/dnet/aton.c Thu Jan 20 03:26:57 2011
@@ -86,7 +86,7 @@ off_aton(char *string, uint16_t *off)
} else {
i = strtol(string, &p, 10);
if (*string == '\0' || (*p != '\0' && *p != '+') ||
- i > IP_OFFMASK)
+ i > (IP_OFFMASK << 3))
return (-1);
*off = htons(((*p == '+') ? IP_MF : 0) | (i >> 3));
}