Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

w2ksp4.exe, WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF

Links

XODOX
Impressum

#1: IO::Socket::INET and 255.255.255.255

Posted on 2011-02-19 00:42:05 by 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--

Report this message