]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
network: simplify instantiate_vlan()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Jul 2019 19:44:19 +0000 (21:44 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Jul 2019 19:44:19 +0000 (21:44 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/network.c

index 904d23f588bc579331880b25000626bd70ca7c87..fa9b7b3ba840665fdaa061d05805f638884282e7 100644 (file)
@@ -579,7 +579,8 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
                return -1;
        }
 
-       err = snprintf(peer, sizeof(peer), "vlan%d-%d", netdev->priv.vlan_attr.vid, vlan_cntr++);
+       err = snprintf(peer, sizeof(peer), "vlan%d-%d",
+                      netdev->priv.vlan_attr.vid, vlan_cntr++);
        if (err < 0 || (size_t)err >= sizeof(peer))
                return -1;
 
@@ -601,14 +602,16 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
                err = lxc_safe_uint(netdev->mtu, &mtu);
                if (err < 0) {
                        errno = -err;
-                       SYSERROR("Failed to parse mtu \"%s\" for interface \"%s\"", netdev->mtu, peer);
+                       SYSERROR("Failed to parse mtu \"%s\" for interface \"%s\"",
+                                netdev->mtu, peer);
                        goto on_error;
                }
 
                err = lxc_netdev_set_mtu(peer, mtu);
                if (err) {
                        errno = -err;
-                       SYSERROR("Failed to set mtu \"%s\" for interface \"%s\"", netdev->mtu, peer);
+                       SYSERROR("Failed to set mtu \"%s\" for interface \"%s\"",
+                                netdev->mtu, peer);
                        goto on_error;
                }
        }
@@ -620,16 +623,15 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
                    NULL,
                };
 
-               err = run_script_argv(handler->name,
-                               handler->conf->hooks_version, "net",
-                               netdev->upscript, "up", argv);
+               err = run_script_argv(handler->name, handler->conf->hooks_version,
+                                     "net", netdev->upscript, "up", argv);
                if (err < 0) {
                        goto on_error;
                }
        }
 
-       DEBUG("Instantiated vlan \"%s\" with ifindex is \"%d\"",
-             peer, netdev->ifindex);
+       DEBUG("Instantiated vlan \"%s\" with ifindex is \"%d\"", peer,
+             netdev->ifindex);
 
        return 0;