diff options
author | delphij <delphij@FreeBSD.org> | 2015-05-19 08:00:39 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-05-19 08:00:39 +0000 |
commit | 4d744c17ad3ab9cecf2a327c78c8e6af7ce357a3 (patch) | |
tree | 3b6b2599911a3b15fb41d70d35b4042394a765b1 /sys/dev/hyperv | |
parent | 8786fdbe9dcbc192740f45e0c056c504a1ba9ccd (diff) | |
download | FreeBSD-src-4d744c17ad3ab9cecf2a327c78c8e6af7ce357a3.zip FreeBSD-src-4d744c17ad3ab9cecf2a327c78c8e6af7ce357a3.tar.gz |
MFC r279819:
Fix CARP when in use in a HyperV environment:
- Bump link state when stopping or starting the interface;
- Don't handle SIOCGIFADDR specially, similar to r277103.
This change is based on a previous revision from Andy Zhang
(Microsoft) who did the diagnostic work and many thanks to
them for their help in supporting the HyperV work.
PR: kern/187203
Diffstat (limited to 'sys/dev/hyperv')
-rw-r--r-- | sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 1f5fc3d..12b0630 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -738,7 +738,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch(cmd) { case SIOCSIFADDR: - case SIOCGIFADDR: +#ifdef INET + if (ifa->ifa_addr->sa_family == AF_INET) { + ifp->if_flags |= IFF_UP; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + hn_ifinit(sc); + arp_ifinit(ifp, ifa); + } else +#endif error = ether_ioctl(ifp, cmd, data); break; case SIOCSIFMTU: @@ -902,6 +909,7 @@ hn_stop(hn_softc_t *sc) printf(" Closing Device ...\n"); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; ret = hv_rf_on_close(device_ctx); @@ -951,6 +959,7 @@ hn_ifinit_locked(hn_softc_t *sc) } ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_link_state_change(ifp, LINK_STATE_UP); } /* |