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

Function cleanup_xaddrs

lib/ff_route.c:317–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315#endif
316
317static int
318cleanup_xaddrs(struct rt_addrinfo *info)
319{
320 int error = EAFNOSUPPORT;
321
322 if (info->rti_info[RTAX_DST] == NULL)
323 return (EINVAL);
324
325 if (info->rti_flags & RTF_LLDATA) {
326 /*
327 * arp(8)/ndp(8) sends RTA_NETMASK for the associated
328 * prefix along with the actual address in RTA_DST.
329 * Remove netmask to avoid unnecessary address masking.
330 */
331 remove_netmask(info);
332 }
333
334 switch (info->rti_info[RTAX_DST]->sa_family) {
335 case AF_INET:
336 error = cleanup_xaddrs_inet(info);
337 break;
338#ifdef INET6
339 case AF_INET6:
340 error = cleanup_xaddrs_inet6(info);
341 break;
342#endif
343 }
344
345 return (error);
346}
347
348static int
349rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,

Callers 1

fill_addrinfoFunction · 0.70

Calls 3

remove_netmaskFunction · 0.70
cleanup_xaddrs_inetFunction · 0.70
cleanup_xaddrs_inet6Function · 0.70

Tested by

no test coverage detected