libnetutils/packet.c - fix a raw socket reception race am: 74346aac9c

Change-Id: I9c57bf11896d4bb975a1f053dee9c23e61c013f2
This commit is contained in:
Maciej Żenczykowski 2020-05-12 02:11:05 +00:00 committed by Automerger Merge Worker
commit e6877b7f16

View file

@ -40,7 +40,7 @@
int fatal(const char*);
int open_raw_socket(const char* ifname __unused, uint8_t hwaddr[ETH_ALEN], int if_index) {
int s = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
int s = socket(PF_PACKET, SOCK_DGRAM, 0);
if (s < 0) return fatal("socket(PF_PACKET)");
struct sockaddr_ll bindaddr = {