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:
@ -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));
|
||||
|
Reference in New Issue
Block a user