* Checks if gateway is suitable for lltable operations. * Lltable code requires AF_LINK gateway with ifindex * and mac address specified. * Returns 0 on success. */
| 1332 | * Returns 0 on success. |
| 1333 | */ |
| 1334 | static int |
| 1335 | cleanup_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 | |
| 1351 | static int |
| 1352 | cleanup_xaddrs_gateway(struct rt_addrinfo *info) |
no outgoing calls
no test coverage detected