diff options
author | gibbs <gibbs@FreeBSD.org> | 2013-05-22 17:13:03 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2013-05-22 17:13:03 +0000 |
commit | aa1ae06135d6b2c982d0fe68e8c58b5d05ae8c14 (patch) | |
tree | f1caf3e4e5d2c636db9e0a16ea44afadc1b56a56 /sys | |
parent | 22c906e7e47bd104bd0a39b343d80ac4409bfa40 (diff) | |
download | FreeBSD-src-aa1ae06135d6b2c982d0fe68e8c58b5d05ae8c14.zip FreeBSD-src-aa1ae06135d6b2c982d0fe68e8c58b5d05ae8c14.tar.gz |
Correct panic on detach of Xen PV network interfaces.
dev/xen/netfront:
In netif_free(), properly stop the interface and drain any pending
timers prior to disconnecting from the backend device.
Remove all media and detach our interface object from the system
prior to deleting it.
PR: kern/176471
Submitted by: Roger Pau Monne <roger.pau@citrix.com>
Reviewed by: gibbs
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/xen/netfront/netfront.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index 88641e3..6548c04 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -2171,10 +2171,14 @@ netfront_detach(device_t dev) static void netif_free(struct netfront_info *info) { + XN_LOCK(info); + xn_stop(info); + XN_UNLOCK(info); + callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); -#if 0 - close_netdev(info); -#endif + ifmedia_removeall(&info->sc_media); + ether_ifdetach(info->xn_ifp); + if_free(info->xn_ifp); } static void |