IO::Socket::INET and 255.255.255.255

IO::Socket::INET and 255.255.255.255

am 19.02.2011 00:42:05 von Brian

--------------enigC6E7D52BCDDC0F68840ABB02
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

I've got a program that wants to broadcast a packet and accept a unicast
reply. I can see with wireshark that the broadcast is made and a node
on the network does respond with it's source set to it's unicast
address, however my perl process never seems to get the response.

If I change the target from 255.255.255.255 to a unicasted address, my
perl process does get the response.

Here's how I'm creating my socket and sending and receiving:

$handle =3D IO::Socket::INET->new(Proto =3D> 'udp',
Broadcast =3D> 1,
ReuseAddr =3D> 1,
PeerPort =3D> '67',
LocalPort =3D> '68',
LocalAddr =3D> "10.10.1.1",
PeerAddr =3D> "255.255.255.255")
or die "socket: $@"; # yes, it uses $@ here

# create DHCP Packet
$inform =3D Net::DHCP::Packet->new(
op =3D> BOOTREQUEST(),
Htype =3D> '0',
Hlen =3D> '0',
Ciaddr =3D> $ARGV[1],
Giaddr =3D> $handle->sockhost(),
Xid =3D> int(rand(0xFFFFFFFF)), # random xid
DHO_DHCP_MESSAGE_TYPE() =3D> DHCPINFORM,
DHO_DHCP_PARAMETER_REQUEST_LIST() =3D> '1 6 15 121',
);

# send request
$handle->send($inform->serialize()) or die "Error sending Inform: $!\n";

#receive response
$handle->recv($newmsg, 1024) or die;
$packet =3D Net::DHCP::Packet->new($newmsg);

Any ideas why my process doesn't get the packet that is unicasted back
to my machine? FWIW, this is being done on a PPP interface.

Cheers,
b.


--------------enigC6E7D52BCDDC0F68840ABB02
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1fA80ACgkQl3EQlGLyuXABXACfYLsXdZzZo6yb4VR0NMpI N62E
GHcAnR0CWWnB1KrK7tDsRniUXW9D0JT5
=XYg8
-----END PGP SIGNATURE-----

--------------enigC6E7D52BCDDC0F68840ABB02--