From 599ce82e341862ef270cb7ca221b341743970c40 Mon Sep 17 00:00:00 2001 From: Dimitri Lozeve Date: Fri, 3 Jun 2016 16:44:03 +0200 Subject: [PATCH] Collect only ARP packets --- arp_mitm.c | 2 +- simple_request.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arp_mitm.c b/arp_mitm.c index 9945e79..4e4acbc 100644 --- a/arp_mitm.c +++ b/arp_mitm.c @@ -46,7 +46,7 @@ int main(int argc, char **argv) (to build it ourselves, we could have used SOCK_RAW) ETH_P_ALL: We want to listen to every EtherType (here, we could also have chosen ETH_P_ARP) */ - int sockfd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)); + int sockfd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP)); if (sockfd < 0) { perror("[FAIL] socket()"); exit(EXIT_FAILURE); diff --git a/simple_request.c b/simple_request.c index c9d8516..1d33c4b 100644 --- a/simple_request.c +++ b/simple_request.c @@ -37,7 +37,7 @@ int main(int argc, char **argv) (to build it ourselves, we could have used SOCK_RAW) ETH_P_ALL: We want to listen to every EtherType (here, we could also have chosen ETH_P_ARP) */ - int sockfd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)); + int sockfd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP)); if (sockfd < 0) { perror("[FAIL] socket()"); exit(EXIT_FAILURE);