summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-03-04 12:37:08 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-03-04 12:37:08 +0000
commit672ae41ef85e10b4ba9cef0b176ce13d5af896e6 (patch)
tree71687faf9c2ab9f8c4c35ab1c81075c260b11a19
parent980e9c348965f29dfac3f770a1232ff54c8ea565 (diff)
fix cass where the specification does not give the router address by using
"" instead of defaulting to NULL, which is a pain to handle afterwards. in the output function, treat empty string address like NULL address problem noticed by rivo nurges <rix@estpak.ee>
-rw-r--r--usr.sbin/bgpctl/irr_output.c4
-rw-r--r--usr.sbin/bgpctl/irr_parser.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/irr_output.c b/usr.sbin/bgpctl/irr_output.c
index 7d30e29fd42..fe91a85b7fb 100644
--- a/usr.sbin/bgpctl/irr_output.c
+++ b/usr.sbin/bgpctl/irr_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_output.c,v 1.2 2007/03/03 12:41:13 henning Exp $ */
+/* $OpenBSD: irr_output.c,v 1.3 2007/03/04 12:37:07 henning Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -50,7 +50,7 @@ write_filters(char *outpath)
while ((r = TAILQ_FIRST(&router_head)) != NULL) {
TAILQ_REMOVE(&router_head, r, entry);
- if (r->address != NULL) {
+ if (r->address != NULL && r->address[0] != '\0') {
for (i = 0; i < strlen(r->address); i++)
if (!allowed_in_address(r->address[i]))
errx(1, "router address \"%s\" contains"
diff --git a/usr.sbin/bgpctl/irr_parser.c b/usr.sbin/bgpctl/irr_parser.c
index 6a21bced1d5..f9fe2e2f149 100644
--- a/usr.sbin/bgpctl/irr_parser.c
+++ b/usr.sbin/bgpctl/irr_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_parser.c,v 1.3 2007/03/04 12:27:46 henning Exp $ */
+/* $OpenBSD: irr_parser.c,v 1.4 2007/03/04 12:37:07 henning Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -211,7 +211,7 @@ parse_policy(char *key, char *val)
struct policy_item *pi;
enum pdir dir;
enum policy_parser_st st = PO_NONE, nextst;
- char *tok, *router = NULL, *p;
+ char *tok, *router = "", *p;
if (!strcmp(key, "import"))
dir = IMPORT;