-/* $OpenBSD: parse.y,v 1.451 2023/04/21 10:47:07 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.452 2023/04/21 10:48:33 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
type = EXT_COMMUNITY_TRANS_IPV4;
}
- switch (type) {
+ switch (type & EXT_COMMUNITY_VALUE) {
case EXT_COMMUNITY_TRANS_TWO_AS:
uval = strtonum(s, 0, USHRT_MAX, &errstr);
if (errstr) {
case EXT_COMMUNITY_TRANS_TWO_AS:
case EXT_COMMUNITY_TRANS_FOUR_AS:
case EXT_COMMUNITY_TRANS_IPV4:
+ case EXT_COMMUNITY_GEN_TWO_AS:
+ case EXT_COMMUNITY_GEN_FOUR_AS:
+ case EXT_COMMUNITY_GEN_IPV4:
case -1:
if (strcmp(s, "*") == 0) {
dflag1 = COMMUNITY_ANY;
switch (type) {
case EXT_COMMUNITY_TRANS_TWO_AS:
+ case EXT_COMMUNITY_GEN_TWO_AS:
if (getcommunity(p, 1, &uval2, &dflag2) == -1)
return (-1);
break;
case EXT_COMMUNITY_TRANS_IPV4:
case EXT_COMMUNITY_TRANS_FOUR_AS:
+ case EXT_COMMUNITY_GEN_IPV4:
+ case EXT_COMMUNITY_GEN_FOUR_AS:
if (getcommunity(p, 0, &uval2, &dflag2) == -1)
return (-1);
break;
-/* $OpenBSD: printconf.c,v 1.165 2023/04/18 14:11:54 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.166 2023/04/21 10:48:33 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
switch (type) {
case EXT_COMMUNITY_TRANS_TWO_AS:
case EXT_COMMUNITY_TRANS_FOUR_AS:
+ case EXT_COMMUNITY_GEN_TWO_AS:
+ case EXT_COMMUNITY_GEN_FOUR_AS:
if ((c->flags >> 8 & 0xff) == COMMUNITY_NEIGHBOR_AS)
printf("neighbor-as:");
else if ((c->flags >> 8 & 0xff) == COMMUNITY_LOCAL_AS)
printf("%s:", log_as(c->data1));
break;
case EXT_COMMUNITY_TRANS_IPV4:
+ case EXT_COMMUNITY_GEN_IPV4:
addr.s_addr = htonl(c->data1);
printf("%s:", inet_ntoa(addr));
break;
case EXT_COMMUNITY_TRANS_TWO_AS:
case EXT_COMMUNITY_TRANS_FOUR_AS:
case EXT_COMMUNITY_TRANS_IPV4:
+ case EXT_COMMUNITY_GEN_TWO_AS:
+ case EXT_COMMUNITY_GEN_FOUR_AS:
+ case EXT_COMMUNITY_GEN_IPV4:
if ((c->flags >> 16 & 0xff) == COMMUNITY_ANY)
printf("* ");
else if ((c->flags >> 16 & 0xff) ==