diff options
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index fe497d6..a1155cd 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -589,6 +589,21 @@ if_attach_internal(struct ifnet *ifp, int vmove) /* Reliably crash if used uninitialized. */ ifp->if_broadcastaddr = NULL; } +#ifdef VIMAGE + else { + /* + * Update the interface index in the link layer address + * of the interface. + */ + for (ifa = ifp->if_addr; ifa != NULL; + ifa = TAILQ_NEXT(ifa, ifa_link)) { + if (ifa->ifa_addr->sa_family == AF_LINK) { + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + sdl->sdl_index = ifp->if_index; + } + } + } +#endif IFNET_WLOCK(); TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); |