From: Vincent Bernat Date: Tue, 27 Apr 2021 08:45:57 +0000 (+0200) Subject: priv: ensure Intel E8xx cards can transmit LLDP packets X-Git-Tag: 1.0.11~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad6d5d831e6cbbfed9dd84bc370e139b013aecfb;p=thirdparty%2Flldpd.git priv: ensure Intel E8xx cards can transmit LLDP packets Fix #444 --- 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,