]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: handle more than one ext. community
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 3 May 2018 12:08:38 +0000 (14:08 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 May 2018 15:44:40 +0000 (17:44 +0200)
The ecommunity was badly read. This fix ensures that all ecom are reads
and stored in local structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_pbr.c

index 343a928ad80bb577842944fa657d03040c2b3efe..1f71d66629409344e42473a6a2fe1358bb76946e 100644 (file)
@@ -332,15 +332,15 @@ static int bgp_pbr_build_and_validate_entry(struct prefix *p,
                ecom = info->attr->ecommunity;
                for (i = 0; i < ecom->size; i++) {
                        ecom_eval = (struct ecommunity_val *)
-                               ecom->val + (i * ECOMMUNITY_SIZE);
-
+                               (ecom->val + (i * ECOMMUNITY_SIZE));
+                       action_count++;
                        if (action_count > ACTIONS_MAX_NUM) {
                                if (BGP_DEBUG(pbr, PBR_ERROR))
                                        zlog_err("%s: flowspec actions exceeds limit (max %u)",
                                                 __func__, action_count);
                                break;
                        }
-                       api_action = &api->actions[action_count];
+                       api_action = &api->actions[action_count - 1];
 
                        if ((ecom_eval->val[1] ==
                             (char)ECOMMUNITY_REDIRECT_VRF) &&