summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_updgrp.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2021-06-16 01:49:19 +0200
committerMark Stapp <mstapp@nvidia.com>2022-08-11 16:58:17 +0200
commitf373ce6cfc8972a39fb074a4408134c235035e67 (patch)
tree909df765cf35304efaf9a2380f1a3a8159e38aa1 /bgpd/bgp_updgrp.c
parentMerge pull request #11778 from AbhishekNR/ttable_mroute (diff)
downloadfrr-f373ce6cfc8972a39fb074a4408134c235035e67.tar.xz
frr-f373ce6cfc8972a39fb074a4408134c235035e67.zip
bgpd: apply cond-adv policy to update group
The new outbound filter to apply conditional advertisement policy was not working properly due to complications with update groups. The two routemaps were properly copied into the update group peer filter but not the conditional advertisement state. Signed-off-by: Quentin Young <qlyoung@nvidia.com> Signed-off-by: Mark Stapp <mstapp@nvidia.com>
Diffstat (limited to 'bgpd/bgp_updgrp.c')
-rw-r--r--bgpd/bgp_updgrp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index 13d5ec6b8..f1173941a 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -218,6 +218,8 @@ static void conf_copy(struct peer *dst, struct peer *src, afi_t afi,
MTYPE_BGP_FILTER_NAME, CONDITION_MAP_NAME(srcfilter));
CONDITION_MAP(dstfilter) = CONDITION_MAP(srcfilter);
}
+
+ dstfilter->advmap.update_type = srcfilter->advmap.update_type;
}
/**
@@ -389,6 +391,9 @@ static unsigned int updgrp_hash_key_make(const void *p)
strlen(filter->advmap.aname), SEED1),
key);
+ if (filter->advmap.update_type)
+ key = jhash_1word(filter->advmap.update_type, key);
+
if (peer->default_rmap[afi][safi].name)
key = jhash_1word(
jhash(peer->default_rmap[afi][safi].name,
@@ -588,6 +593,9 @@ static bool updgrp_hash_cmp(const void *p1, const void *p2)
&& strcmp(fl1->advmap.aname, fl2->advmap.aname)))
return false;
+ if (fl1->advmap.update_type != fl2->advmap.update_type)
+ return false;
+
if ((pe1->default_rmap[afi][safi].name
&& !pe2->default_rmap[afi][safi].name)
|| (!pe1->default_rmap[afi][safi].name