mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-04 21:21:36 +00:00
network: Adds custom mtu support for ipvlan interfaces
Signed-off-by: tomponline <thomas.parrott@canonical.com>
This commit is contained in:
parent
19a503200d
commit
006e135e22
@ -478,6 +478,7 @@ static int instantiate_ipvlan(struct lxc_handler *handler, struct lxc_netdev *ne
|
||||
{
|
||||
char peerbuf[IFNAMSIZ], *peer;
|
||||
int err;
|
||||
unsigned int mtu = 0;
|
||||
|
||||
if (netdev->link[0] == '\0') {
|
||||
ERROR("No link for ipvlan network device specified");
|
||||
@ -504,6 +505,22 @@ static int instantiate_ipvlan(struct lxc_handler *handler, struct lxc_netdev *ne
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
if (netdev->mtu) {
|
||||
err = lxc_safe_uint(netdev->mtu, &mtu);
|
||||
if (err < 0) {
|
||||
errno = -err;
|
||||
SYSERROR("Failed to parse mtu \"%s\" for interface \"%s\"", netdev->mtu, peer);
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
err = lxc_netdev_set_mtu(peer, mtu);
|
||||
if (err < 0) {
|
||||
errno = -err;
|
||||
SYSERROR("Failed to set mtu \"%s\" for interface \"%s\"", netdev->mtu, peer);
|
||||
goto on_error;
|
||||
}
|
||||
}
|
||||
|
||||
if (netdev->upscript) {
|
||||
char *argv[] = {
|
||||
"ipvlan",
|
||||
|
Loading…
Reference in New Issue
Block a user