|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From c00524c9cc7fb498c7244350e25823b8352f078c Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Fri, 19 Sep 2014 23:02:00 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] nspawn: don't try to create veth link with too long ifname
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Reported by: James Lott <james@lottspot.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/nspawn/nspawn.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 5af89c9b32..c22d0cb598 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/nspawn/nspawn.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1657,7 +1657,7 @@ static int setup_veth(pid_t pid, char iface_name[IFNAMSIZ], int *ifi) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/* Use two different interface name prefixes depending whether
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
* we are in bridge mode or not. */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- snprintf(iface_name, IFNAMSIZ, "%s-%s",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ snprintf(iface_name, IFNAMSIZ - 1, "%s-%s",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
arg_network_bridge ? "vb" : "ve", arg_machine);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = generate_mac(&mac_container, CONTAINER_HASH_KEY);
|