in reply to raw sockets
and then bind() the socket to the local address as:use Socket qw(AF_INET pack_sockaddr_in); use Net::Interface; my $intf = Net::Interface->new('eth0'); my $ipaddr = $intf->address(AF_INET);
and this should achieve what you're asking to be able to do.bind(SOCKET, pack_sockaddr_in(0, $ipaddr)) || die "can't bind socket t +o local address";
|
|---|