Add a patch to net/aggregate: don't ignore prefix length from input

stream when -t and -p are used together.  From FreeBSD PR ports/131259.
This commit is contained in:
sthen 2012-05-03 14:11:55 +00:00
parent 5189f3d2f9
commit 6291f884d9
2 changed files with 29 additions and 2 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.13 2011/04/14 13:47:59 sthen Exp $
# $OpenBSD: Makefile,v 1.14 2012/05/03 14:11:55 sthen Exp $
COMMENT= optimise a list of route prefixes
DISTNAME= aggregate-1.6
REVISION= 0
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_ISC:=aggregate/}
@ -16,7 +17,6 @@ WANTLIB= c
CONFIGURE_STYLE= gnu
USE_GROFF = Yes
NO_REGRESS= Yes
.include <bsd.port.mk>

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-aggregate_c,v 1.1 2012/05/03 14:11:55 sthen Exp $
Don't ignore prefix length from input stream when -t and -p are used together.
From FreeBSD PR ports/131259
--- aggregate.c.orig Wed Mar 6 16:59:37 2002
+++ aggregate.c Thu May 3 15:08:40 2012
@@ -261,8 +261,18 @@ int main(int argc, char **argv)
moanf(0, "[line %d] line too long; ignoring line", line);
continue;
}
+ if (buf[i] == '/') {
+ masklen = atoi(buf + i + 1);
+ if (masklen < 1 || masklen > max_prefix_length)
+ {
+ if (!quiet)
+ moanf(0, "[line %d] mask length %d out of range; ignoring line", \
+ line, masklen);
+ continue;
+ }
+ } else
+ masklen = default_prefix_length;
buf[i] = 0;
- masklen = default_prefix_length;
} else {
i = 0;
while (buf[i] != '/' && i < MAX_buf) i++;