]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
priv: ensure Intel E8xx cards can transmit LLDP packets
authorVincent Bernat <vincent@bernat.ch>
Tue, 27 Apr 2021 08:45:57 +0000 (10:45 +0200)
committerVincent Bernat <vincent@bernat.ch>
Tue, 27 Apr 2021 08:45:57 +0000 (10:45 +0200)
Fix #444

NEWS
README.md
src/daemon/priv-linux.c

diff --git a/NEWS b/NEWS
index addd831772ff44bdc0cff4af063d1296ef9fbd17..4ae162e709d47e452661ea823b3b605f4593a086 100644 (file)
--- 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.
index a13457c78b103e81b89f32378418da7f5b912ba9..9bd9f71d1212c91f96d186f760a38fd760b90fd6 100644 (file)
--- 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
 -------
 
index 37865235cec698c3a0e44bba490bd7d4e572c71e..6840477b68cc3547d083e80196f1208cb90807f9 100644 (file)
@@ -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,