* Find next multiaddr for a given interface name. */
| 250 | * Find next multiaddr for a given interface name. |
| 251 | */ |
| 252 | static struct ifmaddrs * |
| 253 | next_ifma(struct ifmaddrs *ifma, const char *name, const sa_family_t family) |
| 254 | { |
| 255 | |
| 256 | for(; ifma != NULL; ifma = ifma->ifma_next) { |
| 257 | struct sockaddr_dl *sdl; |
| 258 | |
| 259 | sdl = (struct sockaddr_dl *)ifma->ifma_name; |
| 260 | if (ifma->ifma_addr->sa_family == family && |
| 261 | strcmp(sdl->sdl_data, name) == 0) |
| 262 | break; |
| 263 | } |
| 264 | |
| 265 | return (ifma); |
| 266 | } |
| 267 | |
| 268 | /* |
| 269 | * Print a description of the network interfaces. |