diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-08-02 13:57:18 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-08-17 16:04:50 -0400 | 
| commit | d7ac4c4d8840d14c50924bffe2497b09c7f8b795 (patch) | |
| tree | a432561af50c1fe0be11eddeff477e96850ccdd2 /zebra/zapi_msg.c | |
| parent | 53216dff6e296442333d7074be8584236867a6ab (diff) | |
zebra: Introduce early route processing on the MetaQ
Currently if an operator does this operation:
sharpd@eva ~/frr8> sudo ip nexthop add id 5000 via 192.168.119.44 dev enp39s0 ; sudo ip route add 10.0.0.1 nhid 5000
2022/06/30 08:52:40 ZEBRA: [ZHQK5-J9M1R] proto2zebra: Please add this protocol(0) to proper rt_netlink.c handling
2022/06/30 08:52:40 ZEBRA: [PS16P-365FK][EC 4043309076] Zebra failed to find the nexthop hash entry for id=5000 in a route entry
sharpd@eva ~/frr8> vtysh -c "show ip route 10.0.0.1"
Routing entry for 0.0.0.0/0
  Known via "kernel", distance 0, metric 100, best
  Last update 00:01:58 ago
  * 192.168.119.1, via enp39s0
The route is dropped by zebra with no warnings.  This is not good,
but unlikely to happen at this point in time.  In order to fix
this issue route processing from inputs needs to happen after nexthop
group processing from inputs.  This was not possible because
nexthop groups are placed on the metaQ.  As such the above
nexthop group creation is placed on the metaQ for processing
in META_QUEUE_NHG.  Then the route is read in and processed
immediately.  The nexthop group is not found ( not processed yet!)
and the route is dropped in zebra.
Modify the code to have early route processing of validity
on the MetaQ.  This preserves the order of operations.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index a578395ef8..b68dbb38b6 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -2034,7 +2034,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)  	struct nhg_backup_info *bnhg = NULL;  	int ret;  	vrf_id_t vrf_id; -	struct nhg_hash_entry nhe; +	struct nhg_hash_entry nhe, *n = NULL;  	s = msg;  	if (zapi_route_decode(s, &api) < 0) { @@ -2161,9 +2161,10 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)  		zebra_nhe_init(&nhe, afi, ng->nexthop);  		nhe.nhg.nexthop = ng->nexthop;  		nhe.backup_info = bnhg; +		n = zebra_nhe_copy(&nhe, 0);  	} -	ret = rib_add_multipath_nhe(afi, api.safi, &api.prefix, src_p, -				    re, &nhe, false); +	ret = rib_add_multipath_nhe(afi, api.safi, &api.prefix, src_p, re, n, +				    false);  	/*  	 * rib_add_multipath_nhe only fails in a couple spots  | 
