Article View: linux.debian.bugs.dist
Article #6915Bug#1155944: tcpxtract skips everything on big-endian systems (s390x)
From: Vladimir Petko
Date: Mon, 30 Nov 2026 20:30
Date: Mon, 30 Nov 2026 20:30
102 lines
6662 bytes
6662 bytes
This is a multi-part MIME message sent by reportbug.
--===============8887290124156262521==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Package: tcpxtract
Version: 1.0.1-19
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu tenacious ubuntu-patch
Dear Maintainer,
tcpxtract was using network byte order and magic number to filter ETHERTYPE_IP.
This caused it to skip everything on s390x in the packet captures.
Note: the patch for this bug builds on ftbfs fix[1]
In Ubuntu, the attached patch was applied to achieve the following:
* d/p/150_ip_header_check.patch: Use network-to-host byte order
conversion before checking ether_type (LP: #2178297).
* d/rules: Check that sample capture contains files.
Thanks for considering the patch.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1153475
-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 'resolute'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 7.0.0-43-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
--===============8887290124156262521==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="tcpxtract_1.0.1-19ubuntu2.debdiff"
diff -Nru tcpxtract-1.0.1/debian/patches/150_ip_header_check.patch tcpxtract-1.0.1/debian/patches/150_ip_header_check.patch
--- tcpxtract-1.0.1/debian/patches/150_ip_header_check.patch 1970-01-01 12:00:00.000000000 +1200
+++ tcpxtract-1.0.1/debian/patches/150_ip_header_check.patch 2026-11-28 21:57:03.000000000 +1300
@@ -0,0 +1,21 @@
+Description: Correctly check ether_type
+ The old code was failing on big endian systems.
+ ethernet->ether_type should be converted from the network
+ byte order to the host byte order. Use constant instead of
+ the magic number.
+Author: Vladimir Petko <vladimir.petko@canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/tcpxtract/+bug/2178297
+Forwarded: no
+Last-Update: 2026-11-28
+
+--- a/tcpxtract.c
++++ b/tcpxtract.c
+@@ -177,7 +177,7 @@
+ udp = (struct sniff_udp*)(packet + size_ethernet + size_ip);
+
+ /* if it ain't IP, bail, hard */
+- if (ethernet->ether_type != 0x08) /* I think 0x08 is IP, at least it looks that way */
++ if (ntohs(ethernet->ether_type) != ETHERTYPE_IP)
+ return;
+
+ switch (ip->ip_p) {
diff -Nru tcpxtract-1.0.1/debian/patches/series tcpxtract-1.0.1/debian/patches/series
--- tcpxtract-1.0.1/debian/patches/series 2026-11-09 09:22:43.000000000 +1300
+++ tcpxtract-1.0.1/debian/patches/series 2026-11-28 21:41:45.000000000 +1300
@@ -12,3 +12,4 @@
120_use-extract-prototype.patch
130_packet-structures-packed.patch
140_enforce_build_order.patch
+150_ip_header_check.patch
diff -Nru tcpxtract-1.0.1/debian/rules tcpxtract-1.0.1/debian/rules
--- tcpxtract-1.0.1/debian/rules 2026-11-09 09:22:43.000000000 +1300
+++ tcpxtract-1.0.1/debian/rules 2026-11-28 21:46:07.000000000 +1300
@@ -9,4 +9,7 @@
override_dh_auto_test:
dh_auto_test
- ./tcpxtract -c tcpxtract.conf -f debian/tests/test.pcap
\ No newline at end of file
+ ./tcpxtract -c tcpxtract.conf -f debian/tests/test.pcap > extract.log 2>&1 \
+ || fail "tcpxtract exited with an error on the sample capture"
+ grep -q "Found file of type" extract.log \
+ || fail "no file was recognized in the sample capture"
--===============8887290124156262521==--
Technical Details
Message-ID:
<O5gaB-fbEC-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Vladimir Petko <vpa1977@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1155944: tcpxtract skips everything on big-endian systems (s390x)
Date: Mon, 30 Nov 2026 21:30:01 +0100
Message-ID: <O5gaB-fbEC-3@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Mon Nov 30 20:23:10 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -0.298
Reply-To: Vladimir Petko <vpa1977@gmail.com>, 1155944@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: andrade@debian.org
X-Debian-Pr-Message: report 1155944
X-Debian-Pr-Package: tcpxtract
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: tcpxtract
X-Gm-Message-State: APuU4Z+6oFVEsIP0K2ylu1+vxU4uKWzzIDPJDrKo25lszv1CbpObcVuF
tbLLvrU+L0gP9lkbqu1Sm6QDN4hMEmPXYZNvBZisihfFRI35Sp8CIuZ2pSC9IWkn
X-Gm-Gg: AZFdTZeOfbDVvvtv2wT6yFUC0BIYs4PA6o8Evu9WY0uvI6QN6YP58oqSxolXK0NToKK
OCoxGvmf0zV/J10fEaZ3sTybiOmO2p+6EI+jKTIfXZVM8Qo7Am406SFC3UAElIDYZen6l+iDU9h
YA23DDoZwIARTgEOb80TNPWnUabhEu+EaFNKjXEGfkaPY/i5Yg5rbFut3HlvlPphnejs5/OC+Db
SPqpgvxH/ptUXk1iApAozqgQU/J6hwLG1j+FbC67+eu9HvrSsl0t4Iu760gfzkvQ8hQBpN4pL9/
EDldGiKt9scA1k9pYYldcOGj9G/i/Qze2MwK4O/pb+iZvao03YuZV+UnRTpqxU/5HOZgo8ShZJ/
4En7aYtdezQ+uHUNULk9tV/lYQjTSnIpZZoD77RsBRuA9QfLLDeD+L3k1wqPJDhFwMJvpSE8SP+
ohKHcctKUwxhjQEONzswYPSYQ+7UaugLTFDUYwMmS4cKKCgmI1mZUoKoj+wMN7ZGXwWbr8lB8ri
eXtEZlIFXctYBNTMwFId5zlqyENLlsWgAQHogZiZhxP7plOokTrf95cqRMY8fFlLeLrqo+SH0Ij
19pq76lksQuKtVFKC7DBvkusVAUEGP1Vk0XSEqfjfnIFooxXHLkAHn36r4HwQrVhXBOPR63xObs
4DkFtdpC4EICBlSQuH2MQFjnjGJbul2HLDiaeZK0EQMTQAoTvhaD2/O6cUL9iRe1NEHomfb3N8J
Y7Ntvruy/QcWQK6pIbUQ==
X-Received: by 2002:a05:7300:601e:b0:376:6aea:ab with SMTP id 5a478bee46e88-3856c5b58e2mr35221893eec.3.1796069951745;
Mon, 30 Nov 2026 12:19:11 -0800 (PST)
X-Google-Original-From: Vladimir Petko <vladimir.petko@canonical.com>
Content-Type: multipart/mixed; boundary="===============8887290124156262521=="
MIME-Version: 1.0
X-Mailer: reportbug 13.2.0+ubuntu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006154
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 102
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 01 Dec 2026 09:17:27 +1300
X-Original-Message-ID: <179606984719.3489713.6426588480921115382.reportbug@vladimirp>