From 3203ee925a1e435291a7d1c315c61fa970f546a4 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 11 Feb 2025 15:32:43 +0100 Subject: [PATCH] confd: Add missing interface type for loopback --- src/confd/src/ietf-interfaces.c | 5 +++++ src/confd/src/ietf-interfaces.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/confd/src/ietf-interfaces.c b/src/confd/src/ietf-interfaces.c index ed2dbc8e..8f4f8d73 100644 --- a/src/confd/src/ietf-interfaces.c +++ b/src/confd/src/ietf-interfaces.c @@ -364,6 +364,7 @@ static int netdag_gen_afspec_add(sr_session_ctx_t *session, struct dagger *net, case IFT_ETH: case IFT_ETHISH: + case IFT_LO: case IFT_UNKNOWN: sr_session_set_error_message(net->session, "%s: unsupported interface type \"%s\"", ifname, lydx_get_cattr(cif, "type")); @@ -394,6 +395,7 @@ static int netdag_gen_afspec_set(sr_session_ctx_t *session, struct dagger *net, case IFT_ETH: case IFT_ETHISH: + case IFT_LO: case IFT_UNKNOWN: return ERR_IFACE(cif, -ENOSYS, "unsupported interface type \"%s\"", lydx_get_cattr(cif, "type")); @@ -408,6 +410,7 @@ static bool netdag_must_del(struct lyd_node *dif, struct lyd_node *cif) switch (iftype_from_iface(cif)) { case IFT_BRIDGE: case IFT_DUMMY: + case IFT_LO: break; case IFT_ETH: case IFT_ETHISH: @@ -492,6 +495,7 @@ 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; case IFT_VETH: @@ -649,6 +653,7 @@ static int netdag_init_iface(struct lyd_node *cif) case IFT_ETHISH: case IFT_GRE: case IFT_GRETAP: + case IFT_LO: case IFT_VXLAN: case IFT_UNKNOWN: break; diff --git a/src/confd/src/ietf-interfaces.h b/src/confd/src/ietf-interfaces.h index 916c8d5d..a3cdf5a2 100644 --- a/src/confd/src/ietf-interfaces.h +++ b/src/confd/src/ietf-interfaces.h @@ -28,6 +28,7 @@ _map(IFT_ETHISH, "infix-if-type:etherlike") \ _map(IFT_GRE, "infix-if-type:gre") \ _map(IFT_GRETAP, "infix-if-type:gretap") \ + _map(IFT_LO, "infix-if-type:loopback") \ _map(IFT_VETH, "infix-if-type:veth") \ _map(IFT_VLAN, "infix-if-type:vlan") \ _map(IFT_VXLAN, "infix-if-type:vxlan") \