in reply to perl udp broadcast

This modules have many dependencies. If I use this code I can send packet if even doesn't have gateway. Is there any way to send it on specific interface without ip on it.
$sock = new IO::Socket::INET( LocalAddr => '192.168.0.138', PeerAddr => '255.255.255.255', PeerPort => '9190', # Port the udp server listens on Proto => 'udp', Broadcast => 1 # Not sure if this is needed, I know the sockopt is ) || die "[ERROR] $!\n"; $sock->sockopt(SO_BROADCAST, 1); print $sock "test\n";

Replies are listed 'Best First'.
Re^2: perl udp broadcast
by Corion (Patriarch) on Jul 15, 2010 at 19:50 UTC

    UDP is based on IP, so you can't send an UDP packet without an IP. Or rather, you'll have to construct a raw packet and send it on the raw interface.