summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 841c7af..6518513 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -584,13 +584,15 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
case SIOCSIFFLAGS:
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_RUNNING) {
+ if (!(ifp->if_flags & IFF_UP) &&
+ (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
/*
* If interface is marked down and it is running,
* then stop and disable it.
*/
bridge_stop(ifp, 1);
- } else if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) {
+ } else if ((ifp->if_flags & IFF_UP) &&
+ !(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
/*
* If interface is marked up and it is stopped, then
* start it.
@@ -699,7 +701,7 @@ bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif)
free(bif, M_DEVBUF);
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
}
@@ -764,7 +766,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg)
*/
LIST_INSERT_HEAD(&sc->sc_iflist, bif, bif_next);
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
else
bstp_stop(sc);
@@ -841,7 +843,7 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
bif->bif_flags = req->ifbr_ifsflags;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1042,7 +1044,7 @@ bridge_ioctl_spri(struct bridge_softc *sc, void *arg)
sc->sc_bridge_priority = param->ifbrp_prio;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1071,7 +1073,7 @@ bridge_ioctl_sht(struct bridge_softc *sc, void *arg)
return (EINVAL);
sc->sc_bridge_hello_time = param->ifbrp_hellotime << 8;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1100,7 +1102,7 @@ bridge_ioctl_sfd(struct bridge_softc *sc, void *arg)
return (EINVAL);
sc->sc_bridge_forward_delay = param->ifbrp_fwddelay << 8;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1129,7 +1131,7 @@ bridge_ioctl_sma(struct bridge_softc *sc, void *arg)
return (EINVAL);
sc->sc_bridge_max_age = param->ifbrp_maxage << 8;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1149,7 +1151,7 @@ bridge_ioctl_sifprio(struct bridge_softc *sc, void *arg)
bif->bif_priority = req->ifbr_priority;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1169,7 +1171,7 @@ bridge_ioctl_sifcost(struct bridge_softc *sc, void *arg)
bif->bif_path_cost = req->ifbr_path_cost;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
bstp_initialization(sc);
return (0);
@@ -1206,13 +1208,13 @@ bridge_init(void *xsc)
struct bridge_softc *sc = (struct bridge_softc *)xsc;
struct ifnet *ifp = sc->sc_ifp;
- if (ifp->if_flags & IFF_RUNNING)
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING)
return;
callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz,
bridge_timer, sc);
- ifp->if_flags |= IFF_RUNNING;
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
bstp_initialization(sc);
return;
}
@@ -1227,7 +1229,7 @@ bridge_stop(struct ifnet *ifp, int disable)
{
struct bridge_softc *sc = ifp->if_softc;
- if ((ifp->if_flags & IFF_RUNNING) == 0)
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
callout_stop(&sc->sc_brcallout);
@@ -1235,7 +1237,7 @@ bridge_stop(struct ifnet *ifp, int disable)
bridge_rtflush(sc, IFBF_FLUSHDYN);
- ifp->if_flags &= ~IFF_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
}
/*
@@ -1279,7 +1281,7 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m)
}
}
- if ((dst_ifp->if_flags & IFF_OACTIVE) == 0)
+ if ((dst_ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0)
(*dst_ifp->if_start)(dst_ifp);
}
@@ -1356,7 +1358,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
* go ahead and send out that interface. Otherwise, the packet
* is dropped below.
*/
- if ((sc->sc_ifp->if_flags & IFF_RUNNING) == 0) {
+ if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
dst_if = ifp;
goto sendunicast;
}
@@ -1381,7 +1383,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
}
LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
dst_if = bif->bif_ifp;
- if ((dst_if->if_flags & IFF_RUNNING) == 0)
+ if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0)
continue;
/*
@@ -1424,7 +1426,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
* XXX Spanning tree consideration here?
*/
- if ((dst_if->if_flags & IFF_RUNNING) == 0) {
+ if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) {
m_freem(m);
BRIDGE_UNLOCK(sc);
return (0);
@@ -1451,7 +1453,7 @@ bridge_start(struct ifnet *ifp)
sc = ifp->if_softc;
- ifp->if_flags |= IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
for (;;) {
IFQ_DEQUEUE(&ifp->if_snd, m);
if (m == 0)
@@ -1485,7 +1487,7 @@ bridge_start(struct ifnet *ifp)
bridge_enqueue(sc, dst_if, m);
}
}
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
return;
}
@@ -1607,7 +1609,7 @@ bridge_forward(struct bridge_softc *sc, struct mbuf *m)
* At this point, we're dealing with a unicast frame
* going to a different interface.
*/
- if ((dst_if->if_flags & IFF_RUNNING) == 0) {
+ if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) {
BRIDGE_UNLOCK(sc);
m_freem(m);
return;
@@ -1663,7 +1665,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
struct ether_header *eh;
struct mbuf *mc;
- if ((sc->sc_ifp->if_flags & IFF_RUNNING) == 0)
+ if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return (m);
BRIDGE_LOCK(sc);
@@ -1829,7 +1831,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
(m->m_flags & (M_BCAST|M_MCAST)) == 0)
continue;
- if ((dst_if->if_flags & IFF_RUNNING) == 0)
+ if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0)
continue;
if (LIST_NEXT(bif, bif_next) == NULL) {
@@ -1985,7 +1987,7 @@ bridge_timer(void *arg)
bridge_rtage(sc);
BRIDGE_UNLOCK(sc);
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
callout_reset(&sc->sc_brcallout,
bridge_rtable_prune_period * hz, bridge_timer, sc);
}
OpenPOWER on IntegriCloud