From: vivek Date: Mon, 21 Sep 2015 04:09:00 +0000 (-0700) Subject: BGP: Ensure default-originate works with update-groups X-Git-Tag: frr-2.0-rc1~1251 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f910ef58c5fffa50a87385e5a60c9221fecb426b;p=matthieu%2Ffrr.git BGP: Ensure default-originate works with update-groups Ticket: CM-7113 Reviewed By: CCR-3458 Testing Done: Manual testing, failed test, bgpsmoke (on 2.5-br) This is a port of patch bgpd-update-groups-fix-default-originate.patch from 2.5-br. Even though default origination is configured for a BGP neighbor through "neighbor default-originate" or "peer-group default-originate", the neighbor may sometimes not receive the default route in some situations. Change to ensure update subgroups also differentiate on default-originate sent status. Signed-off-by: Vivek Venkatraman Reviewed-by: Donald Sharp Reviewed-by: Daniel Walton Reviewed-by: Vipin Kumar --- diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index 6760b27cba..a0e4a5d9e7 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -973,7 +973,8 @@ update_subgroup_find (struct update_group *updgrp, struct peer_af *paf) UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) { - if (subgrp->version != version) + if (subgrp->version != version || + CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE)) continue; /* @@ -1044,6 +1045,10 @@ update_subgroup_can_merge_into (struct update_subgroup *subgrp, if (subgrp->version != target->version) return 0; + if (CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE) != + CHECK_FLAG(target->sflags, SUBGRP_STATUS_DEFAULT_ORIGINATE)) + return 0; + /* * If there are any adv entries on the target, then its adj-out (the * set of advertised routes) does not match that of the other