From 5978edce94f0e36a02a754ff195806677a77f980 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Mon, 7 Aug 2023 15:18:38 +0200 Subject: [PATCH] confd: Explicitly set operstate to up when bringing interfaces up This ensures that the operstate is defined for all interface types. Without supplying this, virtual interfaces (e.g. loopback, dummies, tunnels) will report an "UNKNOWN" operstate. For ports backed by physical (or virtualized) hardware, this option has no effect. --- src/confd/src/confd/ietf-interfaces.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confd/src/confd/ietf-interfaces.c b/src/confd/src/confd/ietf-interfaces.c index 0cc1bffa..3f418eae 100644 --- a/src/confd/src/confd/ietf-interfaces.c +++ b/src/confd/src/confd/ietf-interfaces.c @@ -1021,7 +1021,7 @@ static sr_error_t netdag_gen_iface(struct dagger *net, /* Bring interface back up, if enabled */ attr = lydx_get_cattr(cif, "enabled"); if (!attr || !strcmp(attr, "true")) - fprintf(ip, "link set dev %s up\n", ifname); + fprintf(ip, "link set dev %s up state up\n", ifname); err = err ? : netdag_gen_sysctl(net, dif);