switch (addr->ip.sin_family) {
case AF_INET:
- s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
+ s = socket(AF_PACKET, SOCK_RAW, 0);
if (s == -1){
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
return -1;
close(s);
break;
case AF_INET6:
- s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
+ s = socket(AF_PACKET, SOCK_RAW, 0);
if (s == -1){
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
return -1;
int s;
/* Open a socket to capture all traffic */
- s = socket(AF_PACKET, SOCK_RAW, ETH_P_ALL);
+ s = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (s == -1) {
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
return -1;