Add a test that validates that an unbound packet socket cannot create/join
a fanout group.
Signed-off-by: Gur Stavi
---
tools/testing/selftests/net/psock_fanout.c | 36 ++
1 file changed, 36 insertions(+)
diff --git a/tools/testing/selftests/net/psock_fanout.c
b/tools
Modify test_control_group to have toggle parameter.
When toggle is non-zero, loopback device will be set down for the
initialization of fd[1] which is still expected to successfully join
the fanout.
Signed-off-by: Gur Stavi
---
tools/testing/selftests/net/psock_fanout.c | 42
become RUNNING.
Signed-off-by: Gur Stavi
---
net/packet/af_packet.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index f8942062f776..2ff4b251842d 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
ot;leaving a fanout".
V01: https://lore.kernel.org/netdev/cover.1728303615.git.gur.st...@huawei.com/
Gur Stavi (3):
af_packet: allow fanout_add when socket is not RUNNING
selftests: net/psock_fanout: socket joins fanout when link is down
selftests: net/psock_fanout: unbound socket fanout
net/packe
> Gur Stavi wrote:
> > >
> > > If we don't care about opening up fanout groups to ETH_P_NONE, then
> > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO
> > > return can be added, but ideally without touching the other lines.
>
>
> If we don't care about opening up fanout groups to ETH_P_NONE, then
> patch v2 seems sufficient. If explicitly blocking this, the ENXIO
> return can be added, but ideally without touching the other lines.
I don't think that allowing ETH_P_NONE is relevant.
In my opinion the 2 options that sho
> Gur Stavi wrote:
> > > Gur Stavi wrote:
> > > > > Gur Stavi wrote:
> > > > > > > Gur Stavi wrote:
> > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct
> sock
> &g
> Gur Stavi wrote:
> > > Gur Stavi wrote:
> > > > > Gur Stavi wrote:
> > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock
> *sk,
> > > > > struct fanout_args *args)
> > > > > > >
> Gur Stavi wrote:
> > PACKET socket can retain its fanout membership through link down and up
> > and leave a fanout while closed regardless of link state.
> > However, socket was forbidden from joining a fanout while it was not
> > RUNNING.
> >
> > This pa
> I realized another possible problem. We should consider adding ifindex
> Field to struct packet_fanout to be used for lookup of an existing match.
> There is little sense to bind sockets to different interfaces and then
> put them in the same fanout group.
> If you agree, I can prepare a separate
> Subject: [PATCH net-next v03 1/3] af_packet: allow fanout_add when socket
> is not RUNNING
>
> PACKET socket can retain its fanout membership through link down and up
> and leave a fanout while closed regardless of link state.
> However, socket was forbidden from joining a fanout while it was no
Add a test that validates that an unbound packet socket cannot create/join
a fanout group.
Signed-off-by: Gur Stavi
---
tools/testing/selftests/net/psock_fanout.c | 36 ++
1 file changed, 36 insertions(+)
diff --git a/tools/testing/selftests/net/psock_fanout.c
b/tools
Modify test_control_group to have toggle parameter.
When toggle is non-zero, loopback device will be set down for the
initialization of fd[1] which is still expected to successfully join
the fanout.
Signed-off-by: Gur Stavi
---
tools/testing/selftests/net/psock_fanout.c | 42
RUNNING also implicitly tested that the socket is
bound to a device. An explicit test of ifindex was added instead.
Signed-off-by: Gur Stavi
---
net/packet/af_packet.c | 35 +--
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/net/packet/af_packet.c
7;t try to restore loopback state on failure.
* Rephrase commit message about "leaving a fanout".
V01: https://lore.kernel.org/netdev/cover.1728303615.git.gur.st...@huawei.com/
Gur Stavi (3):
af_packet: allow fanout_add when socket is not RUNNING
selftests: net/psock_fanout: socket jo
> Gur Stavi wrote:
> > > Gur Stavi wrote:
> > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk,
> > > struct fanout_args *args)
> > > > >> err = -EINVAL;
> > > > >>
> > > > >>
> Gur Stavi wrote:
> > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk,
> struct fanout_args *args)
> > >> err = -EINVAL;
> > >>
> > >> spin_lock(&po->bind_lock);
> > >> -if (pac
>> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, struct
>> fanout_args *args)
>> err = -EINVAL;
>>
>> spin_lock(&po->bind_lock);
>> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) &&
>> -match->type == type &&
>> +if (match->type == type &&
>> mat
Modify test_control_group to have toggle parameter.
When toggle is non-zero, loopback device will be set down for the
initialization of fd[1] which is still expected to successfully join
the fanout.
Signed-off-by: Gur Stavi
---
tools/testing/selftests/net/psock_fanout.c | 42
PACKET socket can retain its fanout membership through link down and up
and leave a fanout while closed regardless of link state.
However, socket was forbidden from joining a fanout while it was not
RUNNING.
This patch allows PACKET socket to join fanout while not RUNNING.
Signed-off-by: Gur
g a fanout".
V01: https://lore.kernel.org/netdev/cover.1728303615.git.gur.st...@huawei.com/
Gur Stavi (2):
af_packet: allow fanout_add when socket is not RUNNING
selftests: net/psock_fanout: socket joins fanout when link is down
net/packet/af_packet.c | 10 +++---
21 matches
Mail list logo