diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-08-20 14:42:56 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-08-28 07:51:06 -0400 | 
| commit | e7ff02539c22d6fde61844640bc1659e8588c09b (patch) | |
| tree | 3e6d22c0c7518ec317b78742830ca213f7b89854 /lib/nexthop_group.c | |
| parent | 7cbdabffb6c11570e62e71a8b2818511c4756c60 (diff) | |
lib: Note old ifindex on shutdown
If we have an interface configured in a daemon on shutdown
store the old ifindex value for retrieval on when it is
possibly recreated.
This is especially important for nexthop groups as that we
had at one point in time the ability to restore the
configuration but it was lost when we started deleting
all deleted interfaces.  We need the nexthop group subsystem
to also mark that it has configured an interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop_group.c')
| -rw-r--r-- | lib/nexthop_group.c | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index a8f6e8a405..687cac4062 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -940,6 +940,12 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,  			nhg_hooks.add_nexthop(nhgc, nh);  	} +	if (intf) { +		struct interface *ifp = if_lookup_by_name_all_vrf(intf); + +		if (ifp) +			ifp->configured = true; +	}  	return CMD_SUCCESS;  } @@ -1242,6 +1248,7 @@ void nexthop_group_interface_state_change(struct interface *ifp,  				if (ifp->ifindex != nhop.ifindex)  					continue; +				ifp->configured = true;  				nh = nexthop_new();  				memcpy(nh, &nhop, sizeof(nhop));  | 
