Same parseextvalue() change as in parse.y rev 1.441
authorclaudio <claudio@openbsd.org>
Mon, 30 Jan 2023 16:53:24 +0000 (16:53 +0000)
committerclaudio <claudio@openbsd.org>
Mon, 30 Jan 2023 16:53:24 +0000 (16:53 +0000)
Use 2-byte ASnum encoding as a default when local-as/neighbor-as is used.

usr.sbin/bgpctl/parser.c

index 1e467b3..c1069f9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parser.c,v 1.119 2023/01/24 14:14:15 claudio Exp $ */
+/*     $OpenBSD: parser.c,v 1.120 2023/01/30 16:53:24 claudio Exp $ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1232,11 +1232,11 @@ parseextvalue(int type, char *s, uint32_t *v, uint32_t *flag)
        } else if (strcmp(s, "neighbor-as") == 0) {
                *flag = COMMUNITY_NEIGHBOR_AS;
                *v = 0;
-               return EXT_COMMUNITY_TRANS_FOUR_AS;
+               return EXT_COMMUNITY_TRANS_TWO_AS;
        } else if (strcmp(s, "local-as") == 0) {
                *flag = COMMUNITY_LOCAL_AS;
                *v = 0;
-               return EXT_COMMUNITY_TRANS_FOUR_AS;
+               return EXT_COMMUNITY_TRANS_TWO_AS;
        } else if ((p = strchr(s, '.')) == NULL) {
                /* AS_PLAIN number (4 or 2 byte) */
                strtonum(s, 0, USHRT_MAX, &errstr);