in reply to Intercepting UDP broadcasts

This worked for me on Win32, AS 5.8:
use strict; use warnings; use IO::Socket::INET; $|++; my $port = getservbyname 'bootps', 'udp'; print "Listening on UDP port: $port\n"; my $socket = IO::Socket::INET -> new ( LocalPort => $port, Broadcast => 1, Proto => 'udp', Blocking => 1 ) or die "Failed to bind to socket: $@"; my $mess; while ($socket -> recv ($mess, 1024)) { print "Saw: \n$mess\n"; }
... To test it, I just made a dhcp request which also uses BOOTP
c:\> ipconfig /release c:\> ipconfig /renew

I check to be certain I was on the same lan segment as the other device sending the BOOTP request?
JamesNC
Update: I released and renewed the address on a second machine on my home network and indeed saw both the request and response. I am curious as to how to decode the DHCP message. I started to unpack the message, but I got lazy: See RFC 2131 for the message format.
Here is a link to it: RFC 2131