From: Philippe Guibert Date: Thu, 3 May 2018 12:08:38 +0000 (+0200) Subject: bgpd: handle more than one ext. community X-Git-Tag: frr-6.1-dev~395^2~13 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=149d272b37cb85ac794bd290163bffd2ef8f53d2;p=matthieu%2Ffrr.git bgpd: handle more than one ext. community The ecommunity was badly read. This fix ensures that all ecom are reads and stored in local structure. Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 343a928ad8..1f71d66629 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -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) &&