MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_info_match_nhop

Function check_info_match_nhop

freebsd/net/route/route_ctl.c:449–465  ·  view source on GitHub ↗

* Checks if data in @info matches nexhop @nh. * * Returns 0 on success, * ESRCH if not matched, * ENOENT if filter function returned false */

Source from the content-addressed store, hash-verified

447 * ENOENT if filter function returned false
448 */
449int
450check_info_match_nhop(const struct rt_addrinfo *info, const struct rtentry *rt,
451 const struct nhop_object *nh)
452{
453 const struct sockaddr *gw = info->rti_info[RTAX_GATEWAY];
454
455 if (info->rti_filter != NULL) {
456 if (info->rti_filter(rt, nh, info->rti_filterdata) == 0)
457 return (ENOENT);
458 else
459 return (0);
460 }
461 if ((gw != NULL) && !match_nhop_gw(nh, gw))
462 return (ESRCH);
463
464 return (0);
465}
466
467/*
468 * Checks if nexhop @nh can be rewritten by data in @info because

Callers 3

gw_filter_funcFunction · 0.85
rt_unlinkrteFunction · 0.85
change_mpath_routeFunction · 0.85

Calls 1

match_nhop_gwFunction · 0.85

Tested by

no test coverage detected