mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 21:13:00 +02:00
confd: Make physical port detection compatible with Linux 6.1
The old assumption was that only virtual links would have specific "linkinfo" data. However, somewhere between 5.19 and 6.1, DSA ports gained the ability to report its "conduit" interface via the "linkinfo" attribute. That's great, but unfortunately it broke our heuristic assumptions. The new assumption is that only physical ports will report a "parentbus" attribute. Let's see how long that will last :)
This commit is contained in:
committed by
Joachim Wiberg
parent
4a4733354b
commit
93118b02fe
@@ -19,7 +19,7 @@ phys_ifaces=$(ip -d -j link show | jq -r '
|
||||
.[] |
|
||||
select(.link_type == "ether") |
|
||||
select(.group != "internal") |
|
||||
select(has("linkinfo") | not) |
|
||||
select(has("parentbus")) |
|
||||
.ifname')
|
||||
|
||||
cat <<EOF
|
||||
|
||||
@@ -50,7 +50,7 @@ static bool iface_is_phys(const char *ifname)
|
||||
if (strcmp(attr, "ether"))
|
||||
goto out_free;
|
||||
|
||||
if (!json_unpack(link, "[{s: { s:s }}]", "linkinfo", "info_kind", &attr))
|
||||
if (json_unpack(link, "[{s:s}]", "parentbus", &attr))
|
||||
goto out_free;
|
||||
|
||||
is_phys = true;
|
||||
|
||||
Reference in New Issue
Block a user