summaryrefslogtreecommitdiffstats
path: root/sharpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-10-24 15:49:40 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-11-04 18:34:27 +0100
commitca2b3467830877ca279a7bad6d8c2d162fa45e8e (patch)
treea8fff8d87c37c95bf2dc1f002ee945222de31525 /sharpd
parent*: Add ability for daemons to notice resilience changes (diff)
downloadfrr-ca2b3467830877ca279a7bad6d8c2d162fa45e8e.tar.xz
frr-ca2b3467830877ca279a7bad6d8c2d162fa45e8e.zip
*: Add ability to encode / decode resilence down zapi
At this point add abilty for the encode/decode of the resilience down ZAPI to zebra. Just hookup sharpd at this point in time. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'sharpd')
-rw-r--r--sharpd/sharp_nht.c14
-rw-r--r--sharpd/sharp_zebra.c3
2 files changed, 17 insertions, 0 deletions
diff --git a/sharpd/sharp_nht.c b/sharpd/sharp_nht.c
index da1489976..b032da6a1 100644
--- a/sharpd/sharp_nht.c
+++ b/sharpd/sharp_nht.c
@@ -126,6 +126,20 @@ static void sharp_nhgroup_add_cb(const char *name)
static void sharp_nhgroup_modify_cb(const struct nexthop_group_cmd *nhgc)
{
+ struct sharp_nhg lookup;
+ struct sharp_nhg *snhg;
+ struct nexthop_group_cmd *bnhgc = NULL;
+
+ strlcpy(lookup.name, nhgc->name, sizeof(lookup.name));
+ snhg = sharp_nhg_rb_find(&nhg_head, &lookup);
+
+ if (!nhgc->nhg.nexthop)
+ return;
+
+ if (nhgc->backup_list_name[0])
+ bnhgc = nhgc_find(nhgc->backup_list_name);
+
+ nhg_add(snhg->id, &nhgc->nhg, (bnhgc ? &bnhgc->nhg : NULL));
}
static void sharp_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc,
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index b40c2c622..9d343576d 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -550,6 +550,9 @@ void nhg_add(uint32_t id, const struct nexthop_group *nhg,
bool is_valid = true;
api_nhg.id = id;
+
+ api_nhg.resilience = nhg->nhgr;
+
for (ALL_NEXTHOPS_PTR(nhg, nh)) {
if (api_nhg.nexthop_num >= MULTIPATH_NUM) {
zlog_warn(