summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_nhg.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-10-04 22:12:19 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 17:13:44 +0200
commit724583edaddffda86498967ba51297fa6adcb653 (patch)
tree0c7c6ccf9cc0ee78138f94afdeecdfeb6bc090b7 /zebra/zebra_nhg.c
parentzebra: Remove cleanup and nhg workqueue boilerplate (diff)
downloadfrr-724583edaddffda86498967ba51297fa6adcb653.tar.xz
frr-724583edaddffda86498967ba51297fa6adcb653.zip
zebra: Set the nhe type in the appropriate place
We were setting the nhe type on uninstall when it should be on the install. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_nhg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 44524ec50..da6c2c26c 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -1786,6 +1786,9 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe)
if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)
&& !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) {
+ /* Change its type to us since we are installing it */
+ nhe->type = ZEBRA_ROUTE_NHG;
+
int ret = dplane_nexthop_add(nhe);
switch (ret) {
@@ -1813,8 +1816,6 @@ void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe)
if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)) {
int ret = dplane_nexthop_delete(nhe);
- /* Change its type to us since we are installing it */
- nhe->type = ZEBRA_ROUTE_NHG;
switch (ret) {
case ZEBRA_DPLANE_REQUEST_QUEUED:
SET_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED);