diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-11-21 10:56:47 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-21 10:56:47 -0500 | 
| commit | 01af05fbd55edf444d2e39d9de44f5aef2b37719 (patch) | |
| tree | 16e3d190df7f5b46a2385d528651cac29c649e23 /ospfd | |
| parent | b41f7b1b8e3647dac9826b9768d44c5e80ad1b47 (diff) | |
| parent | 03c4375a4ac2b7a9837b79ab7d0bd732595ded27 (diff) | |
Merge pull request #14834 from opensourcerouting/zclient-nexthop-update
*: move common NHT update decoding bits into lib/
Diffstat (limited to 'ospfd')
| -rw-r--r-- | ospfd/ospf_zebra.c | 28 | 
1 files changed, 9 insertions, 19 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 1af703d88d..19d3c9a083 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -1487,30 +1487,20 @@ void ospf_zebra_import_default_route(struct ospf *ospf, bool unreg)  			 __func__);  } -static int ospf_zebra_import_check_update(ZAPI_CALLBACK_ARGS) +static void ospf_zebra_import_check_update(struct vrf *vrf, struct prefix *match, +					   struct zapi_route *nhr)  { -	struct ospf *ospf; -	struct zapi_route nhr; -	struct prefix matched; +	struct ospf *ospf = vrf->info; -	ospf = ospf_lookup_by_vrf_id(vrf_id);  	if (ospf == NULL || !IS_OSPF_ASBR(ospf)) -		return 0; - -	if (!zapi_nexthop_update_decode(zclient->ibuf, &matched, &nhr)) { -		zlog_err("%s[%u]: Failure to decode route", __func__, -			 ospf->vrf_id); -		return -1; -	} +		return; -	if (matched.family != AF_INET || matched.prefixlen != 0 || -	    nhr.type == ZEBRA_ROUTE_OSPF) -		return 0; +	if (match->family != AF_INET || match->prefixlen != 0 || +	    nhr->type == ZEBRA_ROUTE_OSPF) +		return; -	ospf->nssa_default_import_check.status = !!nhr.nexthop_num; +	ospf->nssa_default_import_check.status = !!nhr->nexthop_num;  	ospf_abr_nssa_type7_defaults(ospf); - -	return 0;  }  int ospf_distribute_list_out_set(struct ospf *ospf, int type, const char *name) @@ -2183,7 +2173,6 @@ static zclient_handler *const ospf_handlers[] = {  	[ZEBRA_REDISTRIBUTE_ROUTE_ADD] = ospf_zebra_read_route,  	[ZEBRA_REDISTRIBUTE_ROUTE_DEL] = ospf_zebra_read_route, -	[ZEBRA_NEXTHOP_UPDATE] = ospf_zebra_import_check_update,  	[ZEBRA_OPAQUE_MESSAGE] = ospf_opaque_msg_handler, @@ -2197,6 +2186,7 @@ void ospf_zebra_init(struct event_loop *master, unsigned short instance)  			      array_size(ospf_handlers));  	zclient_init(zclient, ZEBRA_ROUTE_OSPF, instance, &ospfd_privs);  	zclient->zebra_connected = ospf_zebra_connected; +	zclient->nexthop_update = ospf_zebra_import_check_update;  	/* Initialize special zclient for synchronous message exchanges. */  	struct zclient_options options = zclient_options_default;  | 
