qa: Strip prefix length from NetBSD `ifconfig` output
What changed, and why it matters
This is a tiny test-only fix for parsing network interface output on NetBSD. It changes one regular expression so that Bitcoin Core's functional tests can correctly read IP addresses when NetBSD prints them in CIDR notation (like 127.0.0.1/8). It does not touch any production code, network protocol, wallet, or consensus logic, and it has no security relevance.
No security action required. Treat as a normal QA/test-framework portability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test/functional/test_framework/netutil.py, the all_interfaces() helper parses ifconfig output to discover local interface IPs for functional tests. On NetBSD, modern ifconfig prints addresses as inet 127.0.0.1/8, so the previous regex inet (\S+) captured the trailing /8 prefix length, causing tests to receive invalid addresses. The patch changes the capture to inet ([^\s/]+), stripping the prefix length. The change is explicitly a no-op on other platforms and is confined to the QA test framework.
Changed components
test/functional/test_framework/netutil.pyInspect captured patch +1 / −1
diff --git a/test/functional/test_framework/netutil.py b/test/functional/test_framework/netutil.py
index 034d0ff3..2cbcc7a0 100644
--- a/test/functional/test_framework/netutil.py
+++ b/test/functional/test_framework/netutil.py
@@ -149,7 +149,7 @@ def all_interfaces():
return [
(m["iface"].encode(), ip)
for m in re.finditer(r"(?m)^(?P<iface>\S+):(?P<block>[^\n]*(?:\n[ \t]+[^\n]*)*)", output)
- for ip in re.findall(r"inet (\S+)", m["block"])
+ for ip in re.findall(r"inet ([^\s/]+)", m["block"])
]
else:
raise NotImplementedError(f"all_interfaces is not supported on {sys.platform}")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.