[CRIU] [PATCH] veth: fix off by one error

Tycho Andersen tycho.andersen at canonical.com
Thu Oct 6 08:57:54 PDT 2016


0e869bf82f30ff6bce3d7cdc66779d8b642c82af introduces this bug, which chops
off the last character of the external veth name, and then subsequent
move_veth_to_bridge() calls fail:

(01.012478) Error (criu/net.c:1758): Can't get index of veth69A67O: No such device

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
CC: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/net.c b/criu/net.c
index ea5d7ef..32e51ed 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -915,7 +915,7 @@ static void veth_peer_info(NetDeviceEntry *nde, struct newlink_req *req)
 		char *aux;
 
 		aux = strchrnul(val, '@');
-		addattr_l(&req->h, sizeof(*req), IFLA_IFNAME, val, aux - val - 1);		
+		addattr_l(&req->h, sizeof(*req), IFLA_IFNAME, val, aux - val);
 	}
 }
 
-- 
2.9.3



More information about the CRIU mailing list