diff options
Diffstat (limited to 'sharpd/sharp_nht.c')
| -rw-r--r-- | sharpd/sharp_nht.c | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/sharpd/sharp_nht.c b/sharpd/sharp_nht.c index e76b1016a8..731d58e560 100644 --- a/sharpd/sharp_nht.c +++ b/sharpd/sharp_nht.c @@ -78,8 +78,6 @@ struct sharp_nhg { uint32_t id; char name[256]; - - bool installable; }; static uint32_t nhg_id; @@ -122,9 +120,7 @@ static void sharp_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc, strncpy(lookup.name, nhgc->name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); - if (snhg->installable) - nhg_add(snhg->id, &nhgc->nhg); - + nhg_add(snhg->id, &nhgc->nhg); return; } @@ -137,9 +133,7 @@ static void sharp_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc, strncpy(lookup.name, nhgc->name, sizeof(lookup.name)); snhg = sharp_nhg_rb_find(&nhg_head, &lookup); - if (snhg->installable) - nhg_add(snhg->id, &nhgc->nhg); - + nhg_add(snhg->id, &nhgc->nhg); return; } @@ -153,34 +147,12 @@ static void sharp_nhgroup_delete_cb(const char *name) if (!snhg) return; - if (snhg->installable) - nhg_del(snhg->id); - + nhg_del(snhg->id); sharp_nhg_rb_del(&nhg_head, snhg); XFREE(MTYPE_NHG, snhg); return; } -static void sharp_nhgroup_installable_cb(const struct nexthop_group_cmd *nhgc) -{ - struct sharp_nhg lookup; - struct sharp_nhg *snhg; - - strncpy(lookup.name, nhgc->name, sizeof(lookup.name)); - snhg = sharp_nhg_rb_find(&nhg_head, &lookup); - if (!snhg) - return; - - snhg->installable = nhgc->installable; - - if (snhg->installable) - nhg_add(snhg->id, &nhgc->nhg); - else - nhg_del(snhg->id); - - return; -} - uint32_t sharp_nhgroup_get_id(const char *name) { struct sharp_nhg lookup; @@ -191,9 +163,6 @@ uint32_t sharp_nhgroup_get_id(const char *name) if (!snhg) return 0; - if (!snhg->installable) - return 0; - return snhg->id; } @@ -204,6 +173,5 @@ void sharp_nhgroup_init(void) nexthop_group_init(sharp_nhgroup_add_cb, sharp_nhgroup_add_nexthop_cb, sharp_nhgroup_del_nexthop_cb, - sharp_nhgroup_delete_cb, - sharp_nhgroup_installable_cb); + sharp_nhgroup_delete_cb); } |
