diff options
author | Anton Ivanov <anton.ivanov@cambridgegreys.com> | 2018-03-05 16:29:05 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-03-29 23:18:02 +0300 |
commit | e40238dedb484c8a19f8257e4ef5d77d038f9ad8 (patch) | |
tree | 8bef9aea1db074cf8406f0c6da1d627da35e9449 /arch/um/drivers/vector_kern.c | |
parent | ce471fdbc6173eed5af52df3dca179a509f483d9 (diff) | |
download | linux-e40238dedb484c8a19f8257e4ef5d77d038f9ad8.tar.xz |
Fix vector raw inintialization logic
Vector RAW in UML needs to BPF filter its own MAC only
if QDISC_BYPASS has failed. If QDISC_BYPASS is successful, the
frames originated locally are not visible to readers on the
raw socket.
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/vector_kern.c')
-rw-r--r-- | arch/um/drivers/vector_kern.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 3c764830b93e..02168fe25105 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -188,7 +188,7 @@ static int get_transport_options(struct arglist *def) if (strncmp(transport, TRANS_TAP, TRANS_TAP_LEN) == 0) return (vec_rx | VECTOR_BPF); if (strncmp(transport, TRANS_RAW, TRANS_RAW_LEN) == 0) - return (vec_rx | vec_tx | VECTOR_BPF); + return (vec_rx | vec_tx); return (vec_rx | vec_tx); } @@ -1230,6 +1230,11 @@ static int vector_net_open(struct net_device *dev) irq_rr = (irq_rr + 1) % VECTOR_IRQ_SPACE; } + if ((vp->options & VECTOR_QDISC_BYPASS) != 0) { + if (!uml_raw_enable_qdisc_bypass(vp->fds->rx_fd)) + vp->options = vp->options | VECTOR_BPF; + } + if ((vp->options & VECTOR_BPF) != 0) vp->bpf = uml_vector_default_bpf(vp->fds->rx_fd, dev->dev_addr); |