sd-lldp: fix how we create the LLDP listening socket
Specifiy the ethernet family, and make sure we se the O_CLOEXEC and O_NONBLOCK bits how we should for all fds.
This commit is contained in:
@@ -57,7 +57,7 @@ int lldp_network_bind_raw_socket(int ifindex) {
|
||||
|
||||
assert(ifindex > 0);
|
||||
|
||||
fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
||||
fd = socket(PF_PACKET, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, htons(ETHERTYPE_LLDP));
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user