diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-03-08 17:02:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-03-08 17:02:20 +0000 |
commit | cff0df377f678d46c7cedb88c1e7bfa0b94ce0c1 (patch) | |
tree | c8c01c70acbdefdadce2ec514c76770fc0fee07f /usr.sbin | |
parent | f40715eec1d52abd6c1cd1a528a62a4b653d89a8 (diff) |
res.flags is not only used by the irrfilter so initializing them with
irrfilter flags is causing strange behaviour on other commands (like show fib).
Set the IPV4 and IPV6 flags at the end unless one of them got already set.
OK henning, sthen, deraadt
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 7 | ||||
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 36b892053d2..22b0933d55d 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.156 2010/02/11 12:25:12 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.157 2010/03/08 17:02:19 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -127,8 +127,11 @@ main(int argc, char *argv[]) if ((res = parse(argc, argv)) == NULL) exit(1); - if (res->action == IRRFILTER) + if (res->action == IRRFILTER) { + if (!(res->flags & (F_IPV4|F_IPV6))) + res->flags |= (F_IPV4|F_IPV6); irr_main(res->as.as, res->flags, res->irr_outdir); + } memcpy(&neighbor.addr, &res->peeraddr, sizeof(neighbor.addr)); strlcpy(neighbor.descr, res->peerdesc, sizeof(neighbor.descr)); diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 52499e9bcfa..f1f560d97d0 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.60 2010/01/13 06:04:00 claudio Exp $ */ +/* $OpenBSD: parser.c,v 1.61 2010/03/08 17:02:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -344,7 +344,6 @@ parse(int argc, char *argv[]) bzero(&res, sizeof(res)); res.community.as = COMMUNITY_UNSET; res.community.type = COMMUNITY_UNSET; - res.flags = (F_IPV4 | F_IPV6); TAILQ_INIT(&res.set); if ((res.irr_outdir = getcwd(NULL, 0)) == NULL) { fprintf(stderr, "getcwd failed: %s", strerror(errno)); |