Broadcast packet not being sent
Peter Steele
psteele at maxiscale.com
Mon Jan 12 16:02:14 PST 2009
I am using scapy to construct a UDP broadcast packet. The code I'm using
is:
packet=Ether(dst="ff:ff:ff:ff:ff:ff")/IP(dst="255.255.255.255")/UDP(dpor
t=33333)/payload
sendp(packet)
Send 1 packets.
This works fine when I have an IP assigned to the box. However, when no
IP is assigned, I get the following messages:
The sendp generates these warnings:
WARNING: No route found for IPv6 destination :: (no default route?)
WARNING: No route found (no default route?)
WARNING: No route found (no default route?)
WARNING: No route found (no default route?)
Sent 1 packets.
I assume these warnings are okay, since of course there can't be a route
in a scenario like the one I'm using. It's the same environment a DHCP
client would face. However, despite scapy saying the packet was sent, it
does not in fact leave the machine (I've confirmed this with tcpdump).
As I said, if the box has an IP address, then the packet is sent as
expected, but that defeats the purpose since we are developing a custom
DHCP-like protocol.
The only think suspicious that I am seeing is this error in
/var/log/messages:
Jan 12 16:13:52 kernel: looutput: af=31 unexpected
I get one of these each time I try to send a broadcast when no IP is
assigned. I did an google search but did not any useful hits on this. If
anyone here has any idea what's going on, I'd appreciate some feedback.
I think I have the correct packet constructed, but clearly something is
wrong, and it may very well be user error.
Peter
More information about the freebsd-net
mailing list