patch 'net/pcap: reject non-Ethernet interfaces' has been queued to stable release 25.11.3
Kevin Traynor
ktraynor at redhat.com
Thu Jul 30 14:26:23 CEST 2026
Hi,
FYI, your patch has been queued to stable release 25.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/04/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/4748fe47d7580efa17a5559308814232da237659
Thanks.
Kevin
---
>From 4748fe47d7580efa17a5559308814232da237659 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sun, 19 Apr 2026 09:09:49 -0700
Subject: [PATCH] net/pcap: reject non-Ethernet interfaces
[ upstream commit 7f781c1a864da8f5977602b40ce439100de95632 ]
The pcap PMD sends and receives raw Ethernet frames. If used with
an interface that has a different link type, packets will be malformed.
On FreeBSD and macOS, the loopback interface uses DLT_NULL which expects
a 4-byte address family header instead of an Ethernet header. Sending
Ethernet frames to such interfaces causes kernel warnings like:
looutput: af=-1 unexpected
Add a check after pcap_activate() to verify the interface uses
DLT_EN10MB (Ethernet) link type and reject others with a clear error.
Fixes: 4c173302c307 ("pcap: add new driver")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/pcap/pcap_ethdev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index 37e847c5c5..94b6ecb947 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -533,4 +533,14 @@ open_iface_live(const char *iface, pcap_t **pcap) {
}
+ /*
+ * Verify interface supports Ethernet link type.
+ * Loopback on FreeBSD/macOS uses DLT_NULL which expects a 4-byte
+ * address family header instead of Ethernet, causing kernel warnings.
+ */
+ if (pcap_datalink(*pcap) != DLT_EN10MB) {
+ PMD_LOG(ERR, "%s: not Ethernet (link type %d)",
+ iface, pcap_datalink(*pcap));
+ }
+
if (pcap_setnonblock(*pcap, 1, errbuf)) {
PMD_LOG(ERR, "Couldn't set non-blocking on %s: %s", iface, errbuf);
--
2.55.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-30 13:22:52.302306131 +0100
+++ 0002-net-pcap-reject-non-Ethernet-interfaces.patch 2026-07-30 13:22:52.232386058 +0100
@@ -1 +1 @@
-From 7f781c1a864da8f5977602b40ce439100de95632 Mon Sep 17 00:00:00 2001
+From 4748fe47d7580efa17a5559308814232da237659 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7f781c1a864da8f5977602b40ce439100de95632 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -22,2 +23,2 @@
- drivers/net/pcap/pcap_ethdev.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ drivers/net/pcap/pcap_ethdev.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
@@ -26 +27 @@
-index 56f88f5b89..91d442504a 100644
+index 37e847c5c5..94b6ecb947 100644
@@ -29 +30 @@
-@@ -665,4 +665,15 @@ open_iface_live(const char *iface, pcap_t **pcap)
+@@ -533,4 +533,14 @@ open_iface_live(const char *iface, pcap_t **pcap) {
@@ -37 +38 @@
-+ if (pcap_datalink(pc) != DLT_EN10MB) {
++ if (pcap_datalink(*pcap) != DLT_EN10MB) {
@@ -39,2 +40 @@
-+ iface, pcap_datalink(pc));
-+ goto error;
++ iface, pcap_datalink(*pcap));
@@ -43 +43 @@
- if (pcap_setnonblock(pc, 1, errbuf)) {
+ if (pcap_setnonblock(*pcap, 1, errbuf)) {
More information about the stable
mailing list