* VRF and UDP broadcast frames
@ 2025-08-22 19:16 Ben Greear
2025-08-25 14:16 ` David Ahern
0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2025-08-22 19:16 UTC (permalink / raw)
To: David Ahern, linux-wireless
Hello,
Assume I have a network interface assigned to a VRF (wifi AP interface is what I'm testing now).
I would like to have it be able to send and receive UDP broadcast frames. I am binding the socket
to the AP netdev with SO_BINDTODEVICE. From what I can tell, the socket at least cannot receive
UDP broadcasts sent to it. I do see the broadcast arriving on the AP interface if I run tshark.
Is there any particular issue with UDP broadcast sockets in VRF? Do I have to instead
bind to the vrf netdev instead of the ap netdev?
And always possible I doing something wrong in my socket code, my current test setup
is quite complicated.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: VRF and UDP broadcast frames
2025-08-22 19:16 VRF and UDP broadcast frames Ben Greear
@ 2025-08-25 14:16 ` David Ahern
2025-08-25 15:20 ` Ben Greear
0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2025-08-25 14:16 UTC (permalink / raw)
To: Ben Greear, linux-wireless; +Cc: Ido Schimmel
[ cc'ed Ido ]
On 8/22/25 1:16 PM, Ben Greear wrote:
> Hello,
>
> Assume I have a network interface assigned to a VRF (wifi AP interface
> is what I'm testing now).
> I would like to have it be able to send and receive UDP broadcast
> frames. I am binding the socket
> to the AP netdev with SO_BINDTODEVICE. From what I can tell, the socket
> at least cannot receive
> UDP broadcasts sent to it. I do see the broadcast arriving on the AP
> interface if I run tshark.
>
> Is there any particular issue with UDP broadcast sockets in VRF? Do I
> have to instead
> bind to the vrf netdev instead of the ap netdev?
I am not aware of any issues with VRF and broadcast, but the fcnal-test
suite (covers permutations across the uapi) is lacking broadcast tests.
As I recall you tend to run relatively new kernels, so either device
should work.
I use the fib:* tracepoints as a start point for debugging cases like this.
>
> And always possible I doing something wrong in my socket code, my
> current test setup
> is quite complicated.
>
> Thanks,
> Ben
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: VRF and UDP broadcast frames
2025-08-25 14:16 ` David Ahern
@ 2025-08-25 15:20 ` Ben Greear
0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2025-08-25 15:20 UTC (permalink / raw)
To: David Ahern, linux-wireless; +Cc: Ido Schimmel
On 8/25/25 07:16, David Ahern wrote:
> [ cc'ed Ido ]
>
> On 8/22/25 1:16 PM, Ben Greear wrote:
>> Hello,
>>
>> Assume I have a network interface assigned to a VRF (wifi AP interface
>> is what I'm testing now).
>> I would like to have it be able to send and receive UDP broadcast
>> frames. I am binding the socket
>> to the AP netdev with SO_BINDTODEVICE. From what I can tell, the socket
>> at least cannot receive
>> UDP broadcasts sent to it. I do see the broadcast arriving on the AP
>> interface if I run tshark.
>>
>> Is there any particular issue with UDP broadcast sockets in VRF? Do I
>> have to instead
>> bind to the vrf netdev instead of the ap netdev?
>
> I am not aware of any issues with VRF and broadcast, but the fcnal-test
> suite (covers permutations across the uapi) is lacking broadcast tests.
>
> As I recall you tend to run relatively new kernels, so either device
> should work.
>
> I use the fib:* tracepoints as a start point for debugging cases like this.
I think I just had general mis-understanding about how udp bcast worked.
It seems that if you bind the socket to a specific IP on the interface,
it will not receive bcast frames, even if you set the broadcast flag on
the socket. It will send bcast frames fine when bound like this.
But, if you bind your socket to 255.255.255.255, then it will receive
packets sent to 255.255.255.255 (but not packets sent to 192.168.1.255, for instance).
I was expecting it to be a bit more lenient about how it receives udp
bcast frames.
While poking at this, I found the 'socat' tool, which seems good for testing
this.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-25 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 19:16 VRF and UDP broadcast frames Ben Greear
2025-08-25 14:16 ` David Ahern
2025-08-25 15:20 ` Ben Greear
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox