On Sun, Jun 25, 2017 at 11:41:05PM +0200, Sebastian Benoit wrote:
> ok
> 
> as wor the WELLKNOWN, what do other implementations do?

I'm not aware of other implementations that do a blanket replacement of
"65535:" with something like "WELLKNOWN:" in their CLI output.

Most implementations (after native support for a given well-known
community is added), do replace strings like "65535:666" with a human
readable version like "BLACKHOLE". Subsequently, they often accept both
the numeric and text version of the community as input. In this regard
openbsd is already aligned with the industry pattern.

> If others print it or accept it as input, lets keep it.
> If not, remove it from both your diff and bgpctls output.

ok, below:


diff --git usr.sbin/bgpctl/bgpctl.c usr.sbin/bgpctl/bgpctl.c
index 4d9701da35b..4242b3484ca 100644
--- usr.sbin/bgpctl/bgpctl.c
+++ usr.sbin/bgpctl/bgpctl.c
@@ -1548,7 +1548,7 @@ show_community(u_char *data, u_int16_t len)
                                printf("BLACKHOLE");
                                break;
                        default:
-                               printf("WELLKNOWN:%hu", v);
+                               printf("%hu:%hu", a, v);
                                break;
                        }
                else
diff --git usr.sbin/bgpctl/parser.c usr.sbin/bgpctl/parser.c
index 85300d1cd32..0846436a16b 100644
--- usr.sbin/bgpctl/parser.c
+++ usr.sbin/bgpctl/parser.c
@@ -994,10 +994,6 @@ done:
                case COMMUNITY_BLACKHOLE:
                        /* valid */
                        break;
-               default:
-                       /* unknown */
-                       fprintf(stderr, "Unknown well-known community\n");
-                       return (0);
                }
 
        if ((fs = calloc(1, sizeof(struct filter_set))) == NULL)
diff --git usr.sbin/bgpd/parse.y usr.sbin/bgpd/parse.y
index f0c96051e17..7eec31f2bda 100644
--- usr.sbin/bgpd/parse.y
+++ usr.sbin/bgpd/parse.y
@@ -3019,10 +3019,6 @@ parsecommunity(struct filter_community *c, char *s)
 
        if ((i = getcommunity(s)) == COMMUNITY_ERROR)
                return (-1);
-       if (i == COMMUNITY_WELLKNOWN) {
-               yyerror("Bad community AS number");
-               return (-1);
-       }
        as = i;
 
        if ((i = getcommunity(p)) == COMMUNITY_ERROR)

Reply via email to