summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-18 22:45:22 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-20 22:42:29 +0100
commit7cde237777bb079787d436af253305bb08f0b066 (patch)
treee42051b9e43d4ae687a9c2103bc72b6a933f0e06
parent0ef6f4542584873e10d5c942105ad0ffc53d6108 (diff)
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.
-rw-r--r--src/libsystemd-network/lldp-network.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/lldp-network.c b/src/libsystemd-network/lldp-network.c
index 10729e77b2..f031760351 100644
--- a/src/libsystemd-network/lldp-network.c
+++ b/src/libsystemd-network/lldp-network.c
@@ -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;