FreeBSD Bugzilla – Attachment 170409 Details for
Bug 209427
[PATCH] if_vtnet(4) is not sending LINK_(UP|DOWN) events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed fix, v2
virtio-net-devctl2.diff (text/plain), 1.20 KB, created by
Roman Bogorodskiy
on 2016-05-17 15:14:49 UTC
(
hide
)
Description:
proposed fix, v2
Filename:
MIME Type:
Creator:
Roman Bogorodskiy
Created:
2016-05-17 15:14:49 UTC
Size:
1.20 KB
patch
obsolete
>Index: if_vtnet.c >=================================================================== >--- if_vtnet.c (revision 299744) >+++ if_vtnet.c (working copy) >@@ -1048,6 +1048,7 @@ > > if (ifp->if_drv_flags & IFF_DRV_RUNNING) { > ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >+ vtnet_update_link_status(sc); > vtnet_init_locked(sc); > } > >@@ -2801,7 +2802,7 @@ > VTNET_CORE_LOCK_ASSERT(sc); > > ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >- sc->vtnet_link_active = 0; >+ vtnet_update_link_status(sc); > callout_stop(&sc->vtnet_tick_ch); > > /* Only advisory. */ >@@ -3516,17 +3517,19 @@ > { > struct ifnet *ifp; > int link; >+ int drv_running; > > ifp = sc->vtnet_ifp; >+ drv_running = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; > > VTNET_CORE_LOCK_ASSERT(sc); > link = vtnet_is_link_up(sc); > > /* Notify if the link status has changed. */ >- if (link != 0 && sc->vtnet_link_active == 0) { >+ if (link != 0 && drv_running != 0 && sc->vtnet_link_active == 0) { > sc->vtnet_link_active = 1; > if_link_state_change(ifp, LINK_STATE_UP); >- } else if (link == 0 && sc->vtnet_link_active != 0) { >+ } else if ((link == 0 || drv_running == 0) && sc->vtnet_link_active != 0) { > sc->vtnet_link_active = 0; > if_link_state_change(ifp, LINK_STATE_DOWN); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209427
:
170183
| 170409