]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Treat-as-withdraw if [el]community length is zero 6173/head
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 7 Apr 2020 07:08:16 +0000 (10:08 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 7 Apr 2020 07:08:16 +0000 (10:08 +0300)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_attr.c

index b3944e5f288aa0fd5a263de091e35075987b6a10..d83810ecc2e70a89010b97a5d323757d03dd3414 100644 (file)
@@ -1832,7 +1832,8 @@ bgp_attr_community(struct bgp_attr_parser_args *args)
 
        if (length == 0) {
                attr->community = NULL;
-               return BGP_ATTR_PARSE_PROCEED;
+               return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
+                                         args->total);
        }
 
        attr->community =
@@ -2173,7 +2174,8 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args)
        if (length == 0) {
                attr->lcommunity = NULL;
                /* Empty extcomm doesn't seem to be invalid per se */
-               return BGP_ATTR_PARSE_PROCEED;
+               return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
+                                         args->total);
        }
 
        attr->lcommunity =
@@ -2202,7 +2204,8 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
        if (length == 0) {
                attr->ecommunity = NULL;
                /* Empty extcomm doesn't seem to be invalid per se */
-               return BGP_ATTR_PARSE_PROCEED;
+               return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
+                                         args->total);
        }
 
        attr->ecommunity =