Add --vpn (-X) flag to support sending IP pkts

When a user specifies a `-i tun0` flag for a VPN interface,
this interface expects raw IP packets, not ethernet frames.
The --vpn option allows you to send only IP packets to the
specified interface, and also performs some hacks on the receive
end to ensure we can process the results.

TODO: malloc a fake ethernet header for probe_modules.process_packet
(or better yet, make process_packet always take an IP packet, they
all seem to be implicitly doing that anyway).
This commit is contained in:
Eric
2013-08-31 15:38:13 -04:00
parent 8f5e4beb01
commit 2972bbefdc
8 changed files with 67 additions and 28 deletions

View File

@ -288,7 +288,7 @@ int send_run(int sock)
zconf.probe_module->print_packet(stdout, buf);
} else {
int l = zconf.probe_module->packet_length;
int rc = sendto(sock, buf,
int rc = sendto(sock, buf + zconf.send_ip_pkts*sizeof(struct ethhdr),
l, 0,
(struct sockaddr *)&sockaddr,
sizeof(struct sockaddr_ll));