Commit Graph
3 Commits
Author SHA1 Message Date
Khem Raj 4ec8afbfcf python3-scapy: fix libpcap loading and ptests on musl
- ctypes.util.find_library() relies on "ldconfig -p", gcc or ld, none of
  which exist on a musl target, so find_library("pcap") returns None
  and scapy raises "Cannot find libpcap.so library" even with libpcap
  installed. That disabled conf.use_pcap and BPF filter compilation and
  failed ten ptests (offline sniff() with filters, tcpdump(), tdecode(),
  traceroute). Fall back to loading libpcap.so.1/libpcap.so by name.

- The NetBSD read_routes6() test compares IPv4-compatible IPv6 prefixes
  as strings, but musl's inet_ntop() prints ::127.0.0.0 as ::7f00:0.
  Normalise the expected values with in6_ptop().

Tested with meta-networking-image-ptest-python3-scapy on qemux86-64
with yoe-musl-systemd-wayland: TOTAL: 1 FAIL: 0.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-28 06:57:40 -07:00
Khem Raj c78566f4b0 python3-scapy: fix UnboundLocalError in interact()
The "Emulate interact()" UTScapy regression test failed:

    IPython requested but not found !
    Using the default Python shell: History is disabled.
    Traceback (most recent call last):
      File "/usr/lib/python3.14/site-packages/scapy/main.py", line 857, in interact
        banner += "\n"
    UnboundLocalError: cannot access local variable banner where it is
    not associated with a value

scapy.main.interact() only binds "banner" in the branches handling the
ipython, ptipython, ptpython and bpython shells. The test asks for
ipython, which is not in the image, so scapy falls back to the plain
Python shell and leaves "banner" unbound while still running the
unconditional "banner += \n" for the caller-supplied mybanner.

The test is correct and the bug is in scapy, which still has it in
master, so carry a patch initializing banner from banner_text before the
shell-specific chain.

meta-networking-image-ptest-python3-scapy now reports PASSED=319
FAILED=0, up from PASSED=318 FAILED=1.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-08-19 16:57:43 -07:00
Khem Raj 951255b0da python3-scapy: upgrade 2.6.1 -> 2.7.0
Bump to the v2.7.0 tag. Rebase the ptest ICMPv6 skip patch: upstream
added a "needs_root" tag to the "Sending and receiving an
ICMPv6EchoRequest" test's tag line in test/regression.uts, so the
"skipped_ptest" tag now needs to be appended after "needs_root"
rather than replacing the whole line. With this rebase both hunks
apply with offset only (no fuzz).

Build-verified: python3-scapy builds and packages (including
-ptest) successfully.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-08-14 09:06:32 -07:00