summaryrefslogtreecommitdiff
path: root/pbrd/pbr_map.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-09-10 11:31:39 -0400
committerDonald Sharp <sharpd@nvidia.com>2020-09-11 20:04:45 -0400
commit58a1d249249840694e04f7b31a45c35ef6d067c8 (patch)
tree663ac92256f90326dabc7d099d5eb3b8ba4124c9 /pbrd/pbr_map.c
parent2525fc315a57bb2e9009da83227bf1912ed8759c (diff)
bgpd, lib, pbrd, zebra: Pass by ifname
When installing rules pass by the interface name across zapi. This is being changed because we have a situation where if you quickly create/destroy ephermeal interfaces under linux the upper level protocol may be trying to add a rule for a interface that does not quite exist at the moment. Since ip rules actually want the interface name ( to handle just this sort of situation ) convert over to passing the interface name and storing it and using it in zebra. Ticket: CM-31042 Signed-off-by: Stephen Worley <sworley@nvidia.com> Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pbrd/pbr_map.c')
-rw-r--r--pbrd/pbr_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index 058881cbfc..d6500af881 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -398,7 +398,7 @@ void pbr_map_delete_vrf(struct pbr_map_sequence *pbrms)
pbr_map_delete_common(pbrms);
}
-struct pbr_map_sequence *pbrms_lookup_unique(uint32_t unique, ifindex_t ifindex,
+struct pbr_map_sequence *pbrms_lookup_unique(uint32_t unique, char *ifname,
struct pbr_map_interface **ppmi)
{
struct pbr_map_sequence *pbrms;
@@ -408,7 +408,8 @@ struct pbr_map_sequence *pbrms_lookup_unique(uint32_t unique, ifindex_t ifindex,
RB_FOREACH (pbrm, pbr_map_entry_head, &pbr_maps) {
for (ALL_LIST_ELEMENTS_RO(pbrm->incoming, inode, pmi)) {
- if (pmi->ifp->ifindex != ifindex)
+ if (strncmp(pmi->ifp->name, ifname, INTERFACE_NAMSIZ)
+ != 0)
continue;
if (ppmi)