confd: Allow reconfigurations on dummy and gre interfaces

With the new iftype enum, we see that configuring an existing dummy or
gre interface types was wrongly classified as an error rather than as
a NOP.

Example, before this change, this was OK:

    configure
    set interface foo
    set interface foo ipv4 address 10.0.0.1 prefix-length 24
    leave

However, this was not:

     configure
     set interface foo
    +leave
    +configure
     set interface foo ipv4 address 10.0.0.1 prefix-length 24
     leave
    +<KABOOM>
This commit is contained in:
Tobias Waldekranz
2025-02-11 20:37:00 +01:00
parent c22339c2cd
commit a8b5120871
+3 -2
View File
@@ -423,15 +423,16 @@ static int netdag_gen_afspec_set(sr_session_ctx_t *session, struct dagger *net,
return bridge_gen(dif, cif, ip, 0);
case IFT_VLAN:
return netdag_gen_vlan(net, dif, cif, ip);
case IFT_DUMMY:
case IFT_GRE:
case IFT_GRETAP:
case IFT_VETH:
case IFT_VXLAN:
return 0;
case IFT_DUMMY:
case IFT_ETH:
case IFT_ETHISH:
case IFT_GRE:
case IFT_UNKNOWN:
return ERR_IFACE(cif, -ENOSYS, "unsupported interface type \"%s\"",
lydx_get_cattr(cif, "type"));