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.
This commit is contained in:
Tobias Waldekranz
2023-08-07 15:50:52 +02:00
committed by Joachim Wiberg
parent 1afc2adcfc
commit 5978edce94
+1 -1
View File
@@ -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);