From ad6d5d831e6cbbfed9dd84bc370e139b013aecfb Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 27 Apr 2021 10:45:57 +0200 Subject: [PATCH] priv: ensure Intel E8xx cards can transmit LLDP packets Fix #444 --- NEWS | 4 ++++ README.md | 2 ++ src/daemon/priv-linux.c | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/NEWS b/NEWS index addd8317..4ae162e7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +lldpd (1.0.11) + * Fix: + + Ensure Intel E8xx cards can transmit LLDP packets. + lldpd (1.0.10) * Fix: + Fix chroot directory creation. diff --git a/README.md b/README.md index a13457c7..9bd9f71d 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,8 @@ have such a card (with `lspci`) and stop the embedded LLDP daemon: echo lldp stop > $f done +This may also apply to the `ice` (Intel E8xx cards) driver. + License ------- diff --git a/src/daemon/priv-linux.c b/src/daemon/priv-linux.c index 37865235..6840477b 100644 --- a/src/daemon/priv-linux.c +++ b/src/daemon/priv-linux.c @@ -38,6 +38,9 @@ #pragma clang diagnostic pop #endif +/* Defined in linux/pkt_sched.h */ +#define TC_PRIO_CONTROL 7 + /* Proxy for open */ int priv_open(char *file) @@ -155,6 +158,16 @@ asroot_iface_init_os(int ifindex, char *name, int *fd) return rc; } + /* Set priority to TC_PRIO_CONTROL for ice Intel cards. See #444. */ + int prio = TC_PRIO_CONTROL; + if (setsockopt(*fd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio)) < 0) { + rc = errno; + log_warn("privsep", + "unable to set priority \"control\" to socket for interface %s", + name); + return rc; + } + #ifdef SO_LOCK_FILTER int lock = 1; if (setsockopt(*fd, SOL_SOCKET, SO_LOCK_FILTER, -- 2.39.5