Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153334763
D28859.id84540.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28859.id84540.diff
View Options
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h
--- a/sys/net/ethernet.h
+++ b/sys/net/ethernet.h
@@ -437,6 +437,10 @@
extern void ether_demux(struct ifnet *, struct mbuf *);
extern void ether_ifattach(struct ifnet *, const u_int8_t *);
extern void ether_ifdetach(struct ifnet *);
+#ifdef VIMAGE
+struct vnet;
+extern void ether_reassign(struct ifnet *, struct vnet *, char *);
+#endif
extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
extern int ether_output(struct ifnet *, struct mbuf *,
const struct sockaddr *, struct route *);
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -670,6 +670,28 @@
&VNET_NAME(pfil_ipfw), 0, &sysctl_pfil_ipfw, "I",
"Layer2 filter with IPFW");
+#ifdef VIMAGE
+static void
+bridge_reassign(struct ifnet *ifp, struct vnet *newvnet, char *arg)
+{
+ struct bridge_softc *sc = ifp->if_softc;
+ struct bridge_iflist *bif;
+
+ BRIDGE_LOCK(sc);
+
+ while ((bif = CK_LIST_FIRST(&sc->sc_iflist)) != NULL)
+ bridge_delete_member(sc, bif, 0);
+
+ while ((bif = CK_LIST_FIRST(&sc->sc_spanlist)) != NULL) {
+ bridge_delete_span(sc, bif);
+ }
+
+ BRIDGE_UNLOCK(sc);
+
+ ether_reassign(ifp, newvnet, arg);
+}
+#endif
+
/*
* bridge_clone_create:
*
@@ -716,6 +738,9 @@
/* Now undo some of the damage... */
ifp->if_baudrate = 0;
ifp->if_type = IFT_BRIDGE;
+#ifdef VIMAGE
+ ifp->if_reassign = bridge_reassign;
+#endif
BRIDGE_LIST_LOCK();
LIST_INSERT_HEAD(&V_bridge_list, sc, sc_list);
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -117,9 +117,6 @@
static int ether_resolvemulti(struct ifnet *, struct sockaddr **,
struct sockaddr *);
-#ifdef VIMAGE
-static void ether_reassign(struct ifnet *, struct vnet *, char *);
-#endif
static int ether_requestencap(struct ifnet *, struct if_encap_req *);
#define senderr(e) do { error = (e); goto bad;} while (0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 1:32 PM (2 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31913190
Default Alt Text
D28859.id84540.diff (1 KB)
Attached To
Mode
D28859: bridge: Remove members when assigned to a new vnet
Attached
Detach File
Event Timeline
Log In to Comment