]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Lower precedence for ASNUM_TKN when using together with IPV4/IPV6_TKN
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 15 Aug 2023 09:13:54 +0000 (12:13 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 15 Aug 2023 09:13:54 +0000 (12:13 +0300)
When using together with IPV4/IPV6_TKN, this breaks an existing command like:

```
donatas-pc# clear bgp ipv6 unicast 2a02::1
% Ambiguous command: clear bgp ipv6 unicast 2a02::1
donatas-pc#
```

With this fix:

```
donatas-pc# clear bgp ipv6 unicast 2a02::1
% BGP: Unknown neighbor - "2a02::1"
donatas-pc# clear bgp ipv6 unicast 2.2
% BGP: No IPv6 Unicast peer is configured with AS 2.2
donatas-pc# clear bgp ipv6 unicast 123
% BGP: No IPv6 Unicast peer is configured with AS 123
donatas-pc# clear bgp ipv4 unicast 127.0.0.1
donatas-pc#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
lib/command_match.c

index ff3c48fc310108ca62a6b92f7ef70acf95c46f7d..f740b726008cf7ab5a757e460f11aa00c43a31ab 100644 (file)
@@ -566,9 +566,9 @@ static int score_precedence(enum cmd_token_type type)
        case IPV6_PREFIX_TKN:
        case MAC_TKN:
        case MAC_PREFIX_TKN:
-       case ASNUM_TKN:
        case RANGE_TKN:
                return 2;
+       case ASNUM_TKN:
        case WORD_TKN:
                return 3;
        case VARIABLE_TKN: