]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon/priv: fix PACKET_IGNORE_OUTGOING
authorJon Kohler <jon@nutanix.com>
Thu, 10 Apr 2025 06:59:39 +0000 (23:59 -0700)
committerVincent Bernat <vincent@bernat.ch>
Thu, 10 Apr 2025 08:20:24 +0000 (10:20 +0200)
Switch from netpacket/packet.h to linux/if_packet.h to pick up both
sockaddr_ll and PACKET_IGNORE_OUTGOING.

Fixes case where PACKET_IGNORE_OUTGOING was compiled out due to ifdef
conditional, which caused Linux zerocopy to break.

Fixes #732

Signed-off-by: Jon Kohler <jon@nutanix.com>
include/linux/if_packet.h
src/daemon/priv-linux.c

index 67b61d91d89bf4fc8a54e01ffa3ca253a7fc45c9..467b654bd4c7df2aab3e8db892dbd14739ff21fd 100644 (file)
@@ -57,6 +57,7 @@ struct sockaddr_ll {
 #define PACKET_QDISC_BYPASS            20
 #define PACKET_ROLLOVER_STATS          21
 #define PACKET_FANOUT_DATA             22
+#define PACKET_IGNORE_OUTGOING         23
 
 #define PACKET_FANOUT_HASH             0
 #define PACKET_FANOUT_LB               1
index 9a6f90a4d5d73aef67f174f4583fc4892f96007c..b18f1620b4addcae419688bbacb80f94bfe4c12a 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <regex.h>
 #include <sys/ioctl.h>
-#include <netpacket/packet.h> /* For sockaddr_ll */
 #if defined(__clang__)
 #  pragma clang diagnostic push
 #  pragma clang diagnostic ignored "-Wdocumentation"
@@ -34,6 +33,7 @@
 #include <linux/filter.h> /* For BPF filtering */
 #include <linux/sockios.h>
 #include <linux/if_ether.h>
+#include <linux/if_packet.h>
 #include <linux/ethtool.h>
 #if defined(__clang__)
 #  pragma clang diagnostic pop