From: phessler Date: Sat, 25 Apr 2015 21:44:26 +0000 (+0000) Subject: some people are capitalizing keywords, so ignore case when we test the tokens X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=17248ae1c3996b0d6bb414908c175b857a5103a8;p=openbsd some people are capitalizing keywords, so ignore case when we test the tokens OK henning@ benno@ --- diff --git a/usr.sbin/bgpctl/irr_parser.c b/usr.sbin/bgpctl/irr_parser.c index 0c21209d518..e5598c35643 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.13 2015/04/25 13:23:01 phessler Exp $ */ +/* $OpenBSD: irr_parser.c,v 1.14 2015/04/25 21:44:26 phessler Exp $ */ /* * Copyright (c) 2007 Henning Brauer @@ -231,22 +231,22 @@ parse_policy(char *key, char *val) while ((tok = strsep(&val, " ")) != NULL) { nextst = PO_NONE; if (dir == IMPORT) { - if (!strcmp(tok, "from")) + if (!strcasecmp(tok, "from")) nextst = PO_PEER_KEY; - else if (!strcmp(tok, "at")) + else if (!strcasecmp(tok, "at")) nextst = PO_RTR_KEY; - else if (!strcmp(tok, "action")) + else if (!strcasecmp(tok, "action")) nextst = PO_ACTION_KEY; - else if (!strcmp(tok, "accept")) + else if (!strcasecmp(tok, "accept")) nextst = PO_FILTER_KEY; } else if (dir == EXPORT) { - if (!strcmp(tok, "to")) + if (!strcasecmp(tok, "to")) nextst = PO_PEER_KEY; - else if (!strcmp(tok, "at")) + else if (!strcasecmp(tok, "at")) nextst = PO_RTR_KEY; - else if (!strcmp(tok, "action")) + else if (!strcasecmp(tok, "action")) nextst = PO_ACTION_KEY; - else if (!strcmp(tok, "announce")) + else if (!strcasecmp(tok, "announce")) nextst = PO_FILTER_KEY; }