summaryrefslogtreecommitdiff
path: root/lib/zclient.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 /lib/zclient.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 'lib/zclient.c')
-rw-r--r--lib/zclient.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index b842e7c31b..c5016d22e2 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1424,7 +1424,7 @@ int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s, struct pbr_rule *zrule)
stream_putw(s, zrule->filter.fwmark); /* fwmark */
stream_putl(s, zrule->action.table);
- stream_putl(s, zrule->ifindex);
+ stream_put(s, zrule->ifname, INTERFACE_NAMSIZ);
/* Put length at the first point of the stream. */
stream_putw_at(s, 0, stream_get_endp(s));
@@ -1454,26 +1454,23 @@ stream_failure:
}
bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno,
- uint32_t *priority, uint32_t *unique,
- ifindex_t *ifindex,
+ uint32_t *priority, uint32_t *unique, char *ifname,
enum zapi_rule_notify_owner *note)
{
uint32_t prio, seq, uni;
- ifindex_t ifi;
STREAM_GET(note, s, sizeof(*note));
STREAM_GETL(s, seq);
STREAM_GETL(s, prio);
STREAM_GETL(s, uni);
- STREAM_GETL(s, ifi);
+ STREAM_GET(ifname, s, INTERFACE_NAMSIZ);
if (zclient_debug)
- zlog_debug("%s: %u %u %u %u", __func__, seq, prio, uni, ifi);
+ zlog_debug("%s: %u %u %u %s", __func__, seq, prio, uni, ifname);
*seqno = seq;
*priority = prio;
*unique = uni;
- *ifindex = ifi;
return true;