summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index b9e524c..2c44c87 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1021,8 +1021,16 @@ void
if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
{
struct if_clone *ifc;
+ u_int bif_dlt, bif_hdrlen;
int rc;
+ /*
+ * if_detach_internal() will call the eventhandler to notify
+ * interface departure. That will detach if_bpf. We need to
+ * safe the dlt and hdrlen so we can re-attach it later.
+ */
+ bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen);
+
/*
* Detach from current vnet, but preserve LLADDR info, do not
* mark as dead etc. so that the ifnet can be reattached later.
@@ -1062,6 +1070,9 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
if_attach_internal(ifp, 1, ifc);
+ if (ifp->if_bpf == NULL)
+ bpfattach(ifp, bif_dlt, bif_hdrlen);
+
CURVNET_RESTORE();
}
OpenPOWER on IntegriCloud