]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: ecommunity_token_rt6 is not handled 12720/head
authorDonald Sharp <sharpd@nvidia.com>
Fri, 27 Jan 2023 13:10:08 +0000 (08:10 -0500)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 31 Jan 2023 19:04:42 +0000 (21:04 +0200)
The function ecommunity_str2com_internal appears to want to handle
the ecommunity_token_rt6 enum but skips over it.  Commit
9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081 tried to add this but I really
don't see how this is going to behave correctly.  Add the
ecommunity_token_rt6 case to the switch statement so it is handled
appropriately?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_ecommunity.c

index 62fba1f58ec20770192398aec3354df71149fb43..04005884ae21c78bf04850e7ad8b462857085fcd 100644 (file)
@@ -699,6 +699,7 @@ static struct ecommunity *ecommunity_str2com_internal(const char *str, int type,
        while ((str = ecommunity_gettoken(str, (void *)&eval, &token))) {
                switch (token) {
                case ecommunity_token_rt:
+               case ecommunity_token_rt6:
                case ecommunity_token_soo:
                        if (!keyword_included || keyword) {
                                if (ecom)
@@ -746,7 +747,6 @@ static struct ecommunity *ecommunity_str2com_internal(const char *str, int type,
                                                    ecom->unit_size);
                        break;
                case ecommunity_token_unknown:
-               default:
                        if (ecom)
                                ecommunity_free(&ecom);
                        return NULL;