diff options
author | Donald Sharp <sharpd@nvidia.com> | 2020-09-10 17:31:39 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2020-09-12 02:04:45 +0200 |
commit | 58a1d249249840694e04f7b31a45c35ef6d067c8 (patch) | |
tree | 663ac92256f90326dabc7d099d5eb3b8ba4124c9 /pbrd/pbr_zebra.c | |
parent | Merge pull request #6974 from liron-ze/high-cpu-usage (diff) | |
download | frr-58a1d249249840694e04f7b31a45c35ef6d067c8.tar.xz frr-58a1d249249840694e04f7b31a45c35ef6d067c8.zip |
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_zebra.c')
-rw-r--r-- | pbrd/pbr_zebra.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index a7420974a..269bd6da8 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -208,15 +208,15 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS) enum zapi_rule_notify_owner note; struct pbr_map_sequence *pbrms; struct pbr_map_interface *pmi; - ifindex_t ifi; + char ifname[INTERFACE_NAMSIZ + 1]; uint64_t installed; if (!zapi_rule_notify_decode(zclient->ibuf, &seqno, &priority, &unique, - &ifi, ¬e)) + ifname, ¬e)) return -1; pmi = NULL; - pbrms = pbrms_lookup_unique(unique, ifi, &pmi); + pbrms = pbrms_lookup_unique(unique, ifname, &pmi); if (!pbrms) { DEBUGD(&pbr_dbg_zebra, "%s: Failure to lookup pbrms based upon %u", __func__, @@ -546,7 +546,7 @@ static void pbr_encode_pbr_map_sequence(struct stream *s, stream_putl(s, pbr_nht_get_table(pbrms->nhgrp_name)); else if (pbrms->nhg) stream_putl(s, pbr_nht_get_table(pbrms->internal_nhg_name)); - stream_putl(s, ifp->ifindex); + stream_put(s, ifp->name, INTERFACE_NAMSIZ); } void pbr_send_pbr_map(struct pbr_map_sequence *pbrms, |