2001-07-24 15:00:35

by Antwerpen, Oliver

[permalink] [raw]
Subject: udp-broadcast

Moin!

I don't know if this is the right place to ask, so I'll ask:

I try to send udp to my networks broadcast-address. All I get is a
"permission denied", so I tried to use setsockopt, but that doesn't work
either. It gives my a "protocol not available".

What do I have to do to send my package?

--snip--

ret = setsockopt(my_socket, IPPROTO_UDP, SO_BROADCAST, (void *)&flag,
sizeof(flag) );


ret = sendto(
my_socket,
wake_msg,
strlen(wake_msg),
0,
(struct sockaddr *)&dst_address,
sizeof(struct sockaddr)
);


--snip--

Olli

please cc: me when answering...


2001-07-24 16:35:11

by Ingo Oeser

[permalink] [raw]
Subject: Re: udp-broadcast

On Tue, Jul 24, 2001 at 05:00:45PM +0200, Antwerpen, Oliver wrote:
> Moin!
>
> ret = setsockopt(my_socket, IPPROTO_UDP, SO_BROADCAST, (void *)&flag,
> sizeof(flag) );

Try setsockopt(tx_socket,SOL_SOCKET,SO_BROADCAST,..).

And use an actual broadcast-address as sender.

HTH & Regards

Ingo Oeser
--
Use ReiserFS to get a faster fsck and Ext2 to fsck slowly and gently.