I have been trying for a while now to write a program that sends out a
"spoofed" IP-packet, but I just canīt get it to work. Iīm writing a
program that looks for DHCP-servers on the local ethernet-segment, and i
want to send my packages with source-address 0.0.0.0 and destination
The best way I can think of to do this is something like this:
s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
set options IP_HDRINCL and SO_BROADCAST on the socket.
build my package, IP-header, UDP-header and DHCP-data
sendto(s, &buf, sizeof(buf), MSG_DONTROUTE, &sa, sizeof(sa));
As far as I can remember this used to work on older kernels, the only
thing the kernel modified was the IP checksum, but now it seems to change
the source IP also. Iīm currently running 2.3.99-pre3.
I have searched the net for some example code to do this, but I canīt find
Could someone please point me in the right direction?
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to email@example.com
This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:33 EST