From b290e443181234ba4b8573ecb30f5929f160e1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Wed, 12 Feb 2025 20:58:11 +0100 Subject: [PATCH] Remove interface type Etherlike Instead check if the interface support autonegotion before setting it to an interface. This fix #877 and fix #584 --- src/confd/bin/gen-interfaces | 12 +----------- src/confd/src/ieee802-ethernet-interface.c | 10 +++++----- src/confd/src/ietf-interfaces.c | 6 +----- src/confd/src/ietf-interfaces.h | 1 - src/confd/yang/confd.inc | 2 +- src/confd/yang/infix-if-type.yang | 12 ++++++------ ...2024-10-13.yang => infix-if-type@2025-02-12.yang} | 0 7 files changed, 14 insertions(+), 29 deletions(-) rename src/confd/yang/{infix-if-type@2024-10-13.yang => infix-if-type@2025-02-12.yang} (100%) diff --git a/src/confd/bin/gen-interfaces b/src/confd/bin/gen-interfaces index a984d6be..497328eb 100755 --- a/src/confd/bin/gen-interfaces +++ b/src/confd/bin/gen-interfaces @@ -56,16 +56,6 @@ EOF exit 0 } -iftype() -{ - iftype=$(ip -d -j link show "$1" |jq -r .[].parentbus) - if [ "$iftype" = "virtio" ]; then - echo "infix-if-type:etherlike" - else - echo "infix-if-type:ethernet" - fi -} - # shellcheck disable=SC3043 gen_iface_json() { @@ -75,7 +65,7 @@ gen_iface_json() cat <session, "%s: unsupported interface type \"%s\"", @@ -402,7 +401,6 @@ static int netdag_gen_afspec_set(sr_session_ctx_t *session, struct dagger *net, return 0; case IFT_ETH: - case IFT_ETHISH: case IFT_LO: case IFT_UNKNOWN: return ERR_IFACE(cif, -ENOSYS, "unsupported interface type \"%s\"", @@ -421,7 +419,6 @@ static bool netdag_must_del(struct lyd_node *dif, struct lyd_node *cif) case IFT_LO: break; case IFT_ETH: - case IFT_ETHISH: /* case IFT_LAG: */ /* ... REMEMBER WHEN ADDING BOND SUPPORT ... */ return lydx_get_child(dif, "custom-phys-address"); @@ -441,6 +438,7 @@ static bool netdag_must_del(struct lyd_node *dif, struct lyd_node *cif) ERR_IFACE(cif, -EINVAL, "unsupported interface type \"%s\"", lydx_get_cattr(cif, "type")); return true; + } return false; @@ -505,7 +503,6 @@ static int netdag_gen_iface_del(struct dagger *net, struct lyd_node *dif, switch (type) { case IFT_ETH: - case IFT_ETHISH: case IFT_LO: eth_gen_del(dif, ip); break; @@ -665,7 +662,6 @@ static int netdag_init_iface(struct lyd_node *cif) case IFT_DUMMY: case IFT_ETH: - case IFT_ETHISH: case IFT_GRE: case IFT_GRETAP: case IFT_LO: diff --git a/src/confd/src/ietf-interfaces.h b/src/confd/src/ietf-interfaces.h index 22a0d86d..b6a900f3 100644 --- a/src/confd/src/ietf-interfaces.h +++ b/src/confd/src/ietf-interfaces.h @@ -25,7 +25,6 @@ _map(IFT_BRIDGE, "infix-if-type:bridge") \ _map(IFT_DUMMY, "infix-if-type:dummy") \ _map(IFT_ETH, "infix-if-type:ethernet") \ - _map(IFT_ETHISH, "infix-if-type:etherlike") \ _map(IFT_GRE, "infix-if-type:gre") \ _map(IFT_GRETAP, "infix-if-type:gretap") \ _map(IFT_LAG, "infix-if-type:lag") \ diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index e8f4b354..cb13d6c6 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -27,7 +27,7 @@ MODULES=( "infix-hardware@2024-04-25.yang" "ieee802-dot1q-types@2022-10-29.yang" "infix-ip@2024-09-16.yang" - "infix-if-type@2024-10-13.yang" + "infix-if-type@2025-02-12.yang" "infix-routing@2024-11-27.yang" "ieee802-dot1ab-lldp@2022-03-15.yang" "infix-lldp@2025-01-08.yang" diff --git a/src/confd/yang/infix-if-type.yang b/src/confd/yang/infix-if-type.yang index 8afce55c..6432d7c1 100644 --- a/src/confd/yang/infix-if-type.yang +++ b/src/confd/yang/infix-if-type.yang @@ -11,6 +11,11 @@ module infix-if-type { contact "kernelkit@googlegroups.com"; description "Infix extensions to IANA interfaces types"; + revision 2025-02-12 { + description "Remove interface type etherlike."; + reference "internal"; + } + revision 2024-10-13 { description "Add new interface type dummy."; reference "internal"; @@ -58,12 +63,7 @@ module infix-if-type { description "Any Ethernet interfaces, regardless of speed, RFC 3635."; reference "RFC 3635"; } - identity etherlike { - base infix-interface-type; - base ianaift:ilan; - description "Interface with properties resembling Ethernet"; - reference "RFC 3635"; - } + identity gre { base infix-interface-type; } diff --git a/src/confd/yang/infix-if-type@2024-10-13.yang b/src/confd/yang/infix-if-type@2025-02-12.yang similarity index 100% rename from src/confd/yang/infix-if-type@2024-10-13.yang rename to src/confd/yang/infix-if-type@2025-02-12.yang