Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 10d95ee

Browse files
author
Damien Lespiau
authored
Merge pull request #19 from amshinde/interface-cleanup
Interface cleanup
2 parents 8dddce4 + 37b635f commit 10d95ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/net.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,13 @@ static int hyper_setup_interface(struct rtnl_handle *rth,
10511051

10521052
if (iface->new_device_name && strcmp(iface->new_device_name, iface->device)) {
10531053
fprintf(stdout, "Setting interface name to %s\n", iface->new_device_name);
1054-
hyper_set_interface_name(rth, ifindex, iface->new_device_name);
1054+
if (hyper_set_interface_name(rth, ifindex, iface->new_device_name) < 0) {
1055+
fprintf(stderr, "Set interface name failed for interface %s\n",
1056+
iface->device);
1057+
return -1;
1058+
}
1059+
free(iface->device);
1060+
iface->device = strdup(iface->new_device_name);
10551061
}
10561062

10571063
if (iface->mtu > 0) {

0 commit comments

Comments
 (0)