From b69bf1d98f069c4f72a12946a824643330517ab3 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Sun, 31 Aug 2008 08:29:36 +0000 Subject: Fix AS check in parse_community() -- well-known communities have the AS part set to COMMUNITY_WELLKNOWN which is the same as USHRT_MAX. Figured out by Greg Skinner --- usr.sbin/bgpctl/parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 3bb988847be..c60164cd926 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.50 2008/06/15 09:58:43 claudio Exp $ */ +/* $OpenBSD: parser.c,v 1.51 2008/08/31 08:29:35 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -801,7 +801,7 @@ parse_community(const char *word, struct parse_result *r) type = getcommunity(p); done: - if (as == 0 || as == USHRT_MAX) { + if (as == 0) { fprintf(stderr, "Invalid community\n"); return (0); } @@ -814,7 +814,7 @@ done: break; default: /* unknown */ - fprintf(stderr, "Invalid well-known community\n"); + fprintf(stderr, "Unknown well-known community\n"); return (0); } -- cgit v1.2.3