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:
Lennart Poettering
2016-02-20 22:42:29 +01:00
parent 0ef6f45425
commit 7cde237777
+1 -1
View File
@@ -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;