From 7cde237777bb079787d436af253305bb08f0b066 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Feb 2016 22:45:22 +0100 Subject: 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. --- src/libsystemd-network/lldp-network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd-network') 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; -- cgit v1.2.3-54-g00ecf