[lxc-devel] [lxc/master] Keep veth.pair.name on network shutdown

t-fohrer on Github lxc-bot at linuxcontainers.org
Thu Mar 23 14:01:21 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 522 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170323/3f1fedc7/attachment.bin>
-------------- next part --------------
From ea80ca74d22593e018f132a3777aeb859d9609b3 Mon Sep 17 00:00:00 2001
From: Torsten Fohrer <tfohrer at googlemail.com>
Date: Thu, 23 Mar 2017 14:58:33 +0100
Subject: [PATCH] Keep veth.pair.name on network shutdown

In case of a container that is rebooting, freeing veth.pair.name here results in losing given veth.pair name
(Only if given lxc_netdev is reused).

Signed-off-by: Torsten Fohrer <tfohrer at googlemail.com>
---
 src/lxc/conf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index fc80b01..d0c51f6 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -3026,8 +3026,6 @@ bool lxc_delete_network(struct lxc_handler *handler)
 					WARN("Failed to remove interface \"%s\" from host: %s.", hostveth, strerror(-ret));
 				} else {
 					INFO("Removed interface \"%s\" from host.", hostveth);
-					free(netdev->priv.veth_attr.pair);
-					netdev->priv.veth_attr.pair = NULL;
 				}
 			} else if (strlen(netdev->priv.veth_attr.veth1) > 0) {
 				hostveth = netdev->priv.veth_attr.veth1;


More information about the lxc-devel mailing list