]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
don't try to delete vlan 0 from veth 4351/head
authorflisk <self@flisk.xyz>
Thu, 5 Oct 2023 10:28:03 +0000 (12:28 +0200)
committerflisk <git@flisk.xyz>
Sun, 10 Dec 2023 20:24:05 +0000 (21:24 +0100)
vid 0 is a special value that indicates the absence of a default pvid

Signed-off-by: flisk <self@flisk.xyz>
src/lxc/network.c

index 3fa0bb457e875ac67913ef80a0b39f9d770cfcfd..5ea54e9254ed7d83202844df498ec914d2aacea1 100644 (file)
@@ -465,7 +465,7 @@ static int setup_veth_native_bridge_vlan(char *veth1, struct lxc_netdev *netdev)
                        return log_error_errno(-1, EINVAL, "Failed parsing default_pvid of \"%s\"", netdev->link);
 
                /* If the default PVID on the port is not the specified untagged VLAN, then delete it. */
-               if (default_pvid != netdev->priv.veth_attr.vlan_id) {
+               if (default_pvid != 0 && default_pvid != netdev->priv.veth_attr.vlan_id) {
                        err = lxc_bridge_vlan_del(veth1index, default_pvid);
                        if (err)
                                return log_error_errno(err, errno, "Failed to delete default untagged vlan \"%u\" on \"%s\"", default_pvid, veth1);