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

Function cleanup_xaddrs_lladdr

freebsd/net/rtsock.c:1334–1349  ·  view source on GitHub ↗

* Checks if gateway is suitable for lltable operations. * Lltable code requires AF_LINK gateway with ifindex * and mac address specified. * Returns 0 on success. */

Source from the content-addressed store, hash-verified

1332 * Returns 0 on success.
1333 */
1334static int
1335cleanup_xaddrs_lladdr(struct rt_addrinfo *info)
1336{
1337 struct sockaddr_dl *sdl = (struct sockaddr_dl *)info->rti_info[RTAX_GATEWAY];
1338
1339 if (sdl->sdl_family != AF_LINK)
1340 return (EINVAL);
1341
1342 if (sdl->sdl_index == 0)
1343 return (EINVAL);
1344
1345 if (offsetof(struct sockaddr_dl, sdl_data) + sdl->sdl_nlen + sdl->sdl_alen > sdl->sdl_len)
1346 return (EINVAL);
1347
1348 return (0);
1349}
1350
1351static int
1352cleanup_xaddrs_gateway(struct rt_addrinfo *info)

Callers 1

cleanup_xaddrs_gatewayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected