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

Function cleanup_xaddrs_lladdr

lib/ff_route.c:163–178  ·  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

161 * Returns 0 on success.
162 */
163static int
164cleanup_xaddrs_lladdr(struct rt_addrinfo *info)
165{
166 struct sockaddr_dl *sdl = (struct sockaddr_dl *)info->rti_info[RTAX_GATEWAY];
167
168 if (sdl->sdl_family != AF_LINK)
169 return (EINVAL);
170
171 if (sdl->sdl_index == 0)
172 return (EINVAL);
173
174 if (offsetof(struct sockaddr_dl, sdl_data) + sdl->sdl_nlen + sdl->sdl_alen > sdl->sdl_len)
175 return (EINVAL);
176
177 return (0);
178}
179
180static int
181cleanup_xaddrs_gateway(struct rt_addrinfo *info)

Callers 1

cleanup_xaddrs_gatewayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected