[systemd-commits] src/nspawn

Tom Gundersen tomegun at kemper.freedesktop.org
Fri Sep 19 14:02:16 PDT 2014


 src/nspawn/nspawn.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c00524c9cc7fb498c7244350e25823b8352f078c
Author: Tom Gundersen <teg at jklm.no>
Date:   Fri Sep 19 23:02:00 2014 +0200

    nspawn: don't try to create veth link with too long ifname
    
    Reported by: James Lott <james at lottspot.com>

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 5af89c9..c22d0cb 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1657,7 +1657,7 @@ static int setup_veth(pid_t pid, char iface_name[IFNAMSIZ], int *ifi) {
 
         /* Use two different interface name prefixes depending whether
          * we are in bridge mode or not. */
-        snprintf(iface_name, IFNAMSIZ, "%s-%s",
+        snprintf(iface_name, IFNAMSIZ - 1, "%s-%s",
                  arg_network_bridge ? "vb" : "ve", arg_machine);
 
         r = generate_mac(&mac_container, CONTAINER_HASH_KEY);



More information about the systemd-commits mailing list