diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-05 22:34:09 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-05 22:34:09 +0000 |
commit | 0b8e4a2a36e9bfcfb00ff7e53775b9f7f8a88898 (patch) | |
tree | d9641c1ddfebd0e710da10a8f32c8df9f356b2d6 | |
parent | 66eba4150e831f0fed47e24481bb492a3ea2b8fe (diff) |
RPSL spec says route: is single-valued... nontheless, in the APNIC db:
route: 203.94.216.0/21,
origin: AS17813
so we need to cut trailing ',' away
-rw-r--r-- | usr.sbin/bgpctl/irr_parser.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/irr_parser.c b/usr.sbin/bgpctl/irr_parser.c index 18dca18ba6a..063faba1753 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.7 2007/03/05 17:31:12 henning Exp $ */ +/* $OpenBSD: irr_parser.c,v 1.8 2007/03/05 22:34:08 henning Exp $ */ /* * Copyright (c) 2007 Henning Brauer <henning@openbsd.org> @@ -410,5 +410,9 @@ parse_route(char *key, char *val) if (strcmp(key, "route")) /* ignore everything else */ return (0); + /* route is single-value, but seen trailing , in the wild */ + if (strlen(val) > 0 && val[strlen(val) - 1] == ',') + val[strlen(val) - 1] = '\0'; + return (prefixset_addmember(val)); } |