in reply to Re^3: Figuring out which network interface a broadcast packet came in on?
in thread Figuring out which network interface a broadcast packet came in on?
getsockopt and setsockopt allow you to get more info about a socket. e.g.
I just don't know how to read or write the ancillary messages once I set the IP_PKTINFO socket option. In C it's stuff like sendmsg, recvmsg or cmsg.# Get the original destination of the connection # that was redirected to our socket my $p= getsockopt $client, $SOL_IP, $SO_ORIGINAL_DST; $orig_destaddr=inet_ntoa(substr($p,4,4)); $orig_destport=unpack('n',substr($p,2,2));
DHCP doesn't really require high performance - legitimate client machines should not be sending DHCP packets at a high rate, so perl isn't such a bad fit other than this problem I'm having. A perl DHCP server won't be as prone to buffer overflows and will be flexible and more easily extensible.
|
|---|