From: Christian Brauner Date: Wed, 3 Jul 2019 19:44:19 +0000 (+0200) Subject: network: simplify instantiate_vlan() X-Git-Tag: lxc-3.2.0~14^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4d684109c4ce9f6ba917ae60c9fb160ef84a8db;p=thirdparty%2Flxc.git network: simplify instantiate_vlan() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/network.c b/src/lxc/network.c index 904d23f58..fa9b7b3ba 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -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;