EACCES sending UDP to broadcast address?
Subsystems (2)
I'm running as root user, 4.0-rc6 + hack kernel.
User-space app is (or should be) trying to send a UDP frame to 255.255.255.255 destination.
I am getting EACCESS from sendmmsg.
Is this expected? Is there something even more special than root these days?
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 9 lines · Ben Greear
I'm running as root user, 4.0-rc6 + hack kernel.
User-space app is (or should be) trying to send a UDP frame to 255.255.255.255 destination.
I am getting EACCESS from sendmmsg.
Is this expected? Is there something even more special than root these days?
man 7 socket
SO_BROADCAST
Set or get the broadcast flag. When enabled, datagram
sockets are allowed to send packets to a broadcast address. This option has no effect on stream-oriented
sockets.
root user still has to use this option.
Quoted 21 lines · Eric Dumazet
Quoted 9 lines · Ben Greear
I'm running as root user, 4.0-rc6 + hack kernel.
User-space app is (or should be) trying to send a UDP frame to 255.255.255.255 destination.
I am getting EACCESS from sendmmsg.
Is this expected? Is there something even more special than root these days?
man 7 socket
SO_BROADCAST
Set or get the broadcast flag. When enabled, datagram
sockets are allowed to send packets to a broadcast address. This option has no effect on stream-oriented
sockets.
Quoted 1 line
root user still has to use this option.
Thanks, I'll go do that.
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
David Miller
maintainerFrom: Ben Greear <[email protected]>
Date: Thu, 09 Apr 2015 18:04:44 -0700
Quoted 9 lines
I'm running as root user, 4.0-rc6 + hack kernel.
User-space app is (or should be) trying to send a UDP frame to 255.255.255.255 destination.
I am getting EACCESS from sendmmsg.
Is this expected? Is there something even more special than root these days?
You can't send to broadcast addresses without setting the SOCK_BROADCAST socket option.
I didn't know the answer to this, it took me 10 seconds of grepping around under net/ipv4 to figure it out. You could have done this too.