Discussion:
sendto : permission denied.. in linux systems
(too old to reply)
xoinki
2006-04-17 14:42:21 UTC
Permalink
hi all,
we are gettin this error when we try to broadcast a datagram over a
subnet.
we have 3 systems in the subnet addressed 192.168.15.1,
192.168.15.2,192.168.15.3
and when we try to send datagrams over the broadcast address
"192.168.15.0" it is giving this permission denied error. but the same
address is working fine for ping command.
pleeze help,
waiting for u r reply,
Xoinki
Nils O. Selåsdal
2006-04-17 16:29:02 UTC
Permalink
Post by xoinki
hi all,
we are gettin this error when we try to broadcast a datagram over a
subnet.
we have 3 systems in the subnet addressed 192.168.15.1,
192.168.15.2,192.168.15.3
and when we try to send datagrams over the broadcast address
"192.168.15.0" it is giving this permission denied error. but the same
address is working fine for ping command.
pleeze help,
waiting for u r reply,
Xoinki
You need to atleast set the SO_BROADCAST socket option.
Barry Margolin
2006-04-18 01:24:47 UTC
Permalink
Post by Nils O. Selåsdal
Post by xoinki
hi all,
we are gettin this error when we try to broadcast a datagram over a
subnet.
we have 3 systems in the subnet addressed 192.168.15.1,
192.168.15.2,192.168.15.3
and when we try to send datagrams over the broadcast address
"192.168.15.0" it is giving this permission denied error. but the same
address is working fine for ping command.
pleeze help,
waiting for u r reply,
Xoinki
You need to atleast set the SO_BROADCAST socket option.
And the correct broadcast address is 192.168.15.255 (assuming a
255.255.255.0 subnet mask). Many systems allow .0 for compatibility
with a mistake in early TCP/IP RFC's, but .255 is the standard.
--
Barry Margolin, ***@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Rick Jones
2006-04-18 01:40:27 UTC
Permalink
And the correct broadcast address is 192.168.15.255 (assuming a >
255.255.255.0 subnet mask). Many systems allow .0 for compatibility
with a mistake in early TCP/IP RFC's, but .255 is the standard.
And those that do allow .0 may only accept it as an _inbound_
broadcast, and are not (should not IMO) be willing to source a
broadcast to .0.

rick jones
--
oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
purple_stars
2006-04-19 19:25:43 UTC
Permalink
and if you're opening a protected port you need to be suid 0 (root) to
do it, ping works because it's set suid 0
Post by Rick Jones
And the correct broadcast address is 192.168.15.255 (assuming a >
255.255.255.0 subnet mask). Many systems allow .0 for compatibility
with a mistake in early TCP/IP RFC's, but .255 is the standard.
And those that do allow .0 may only accept it as an _inbound_
broadcast, and are not (should not IMO) be willing to source a
broadcast to .0.
rick jones
--
oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Loading...