@@ -2722,6 +2722,22 @@ bpf_detach(struct bpf_if *bp)
|
||||
BPF_UNLOCK();
|
||||
}
|
||||
|
||||
#ifdef VIMAGE
|
||||
/*
|
||||
* Move bpf to a different VNET. This KPI is a crutch to support if_vmove
|
||||
* and is not supposed to be used anywhere else.
|
||||
*/
|
||||
void
|
||||
bpf_vmove(struct bpf_if *bp)
|
||||
{
|
||||
|
||||
BPF_LOCK();
|
||||
LIST_REMOVE(bp, bif_next);
|
||||
LIST_INSERT_HEAD(&V_bpf_iflist, bp, bif_next);
|
||||
BPF_UNLOCK();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
bpf_peers_present_if(struct ifnet *ifp)
|
||||
{
|
||||
|
||||
@@ -425,6 +425,7 @@ CK_LIST_HEAD(bpfd_list, bpf_d);
|
||||
struct bpf_if * bpf_attach(const char *, u_int, u_int,
|
||||
const struct bif_methods *, void *);
|
||||
void bpf_detach(struct bpf_if *);
|
||||
void bpf_vmove(struct bpf_if *bp);
|
||||
void bpf_bufheld(struct bpf_d *d);
|
||||
int bpf_validate(const struct bpf_insn *, int);
|
||||
void bpf_tap(struct bpf_if *, u_char *, u_int);
|
||||
|
||||
@@ -1285,6 +1285,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
|
||||
*/
|
||||
CURVNET_SET_QUIET(new_vnet);
|
||||
if_attach_internal(ifp, true);
|
||||
bpf_vmove(ifp->if_bpf);
|
||||
CURVNET_RESTORE();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user