View | Details | Raw Unified | Return to bug 209427 | Differences between
and this patch

Collapse All | Expand All

(-)if_vtnet.c (-3 / +6 lines)
Lines 1048-1053 Link Here
1048
1048
1049
	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
1049
	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
1050
		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1050
		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1051
		vtnet_update_link_status(sc);
1051
		vtnet_init_locked(sc);
1052
		vtnet_init_locked(sc);
1052
	}
1053
	}
1053
1054
Lines 2801-2807 Link Here
2801
	VTNET_CORE_LOCK_ASSERT(sc);
2802
	VTNET_CORE_LOCK_ASSERT(sc);
2802
2803
2803
	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2804
	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2804
	sc->vtnet_link_active = 0;
2805
	vtnet_update_link_status(sc);
2805
	callout_stop(&sc->vtnet_tick_ch);
2806
	callout_stop(&sc->vtnet_tick_ch);
2806
2807
2807
	/* Only advisory. */
2808
	/* Only advisory. */
Lines 3516-3532 Link Here
3516
{
3517
{
3517
	struct ifnet *ifp;
3518
	struct ifnet *ifp;
3518
	int link;
3519
	int link;
3520
	int drv_running;
3519
3521
3520
	ifp = sc->vtnet_ifp;
3522
	ifp = sc->vtnet_ifp;
3523
	drv_running = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0;
3521
3524
3522
	VTNET_CORE_LOCK_ASSERT(sc);
3525
	VTNET_CORE_LOCK_ASSERT(sc);
3523
	link = vtnet_is_link_up(sc);
3526
	link = vtnet_is_link_up(sc);
3524
3527
3525
	/* Notify if the link status has changed. */
3528
	/* Notify if the link status has changed. */
3526
	if (link != 0 && sc->vtnet_link_active == 0) {
3529
	if (link != 0 && drv_running != 0 && sc->vtnet_link_active == 0) {
3527
		sc->vtnet_link_active = 1;
3530
		sc->vtnet_link_active = 1;
3528
		if_link_state_change(ifp, LINK_STATE_UP);
3531
		if_link_state_change(ifp, LINK_STATE_UP);
3529
	} else if (link == 0 && sc->vtnet_link_active != 0) {
3532
	} else if ((link == 0 || drv_running == 0) && sc->vtnet_link_active != 0) {
3530
		sc->vtnet_link_active = 0;
3533
		sc->vtnet_link_active = 0;
3531
		if_link_state_change(ifp, LINK_STATE_DOWN);
3534
		if_link_state_change(ifp, LINK_STATE_DOWN);
3532
	}
3535
	}

Return to bug 209427