Module Name:    src
Committed By:   pooka
Date:           Wed Apr  2 19:44:15 UTC 2014

Modified Files:
        src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
use if_initname() instead of homegrown sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.46 src/sys/rump/net/lib/libvirtif/if_virt.c:1.47
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.46	Thu Mar 20 20:42:08 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Apr  2 19:44:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.46 2014/03/20 20:42:08 christos Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.46 2014/03/20 20:42:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -109,7 +109,8 @@ virtif_clone(struct if_clone *ifc, int n
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_num = num;
 	ifp = &sc->sc_ec.ec_if;
-	snprintf(ifp->if_xname, sizeof(ifp->if_xname), "%s%d", VIF_NAME, num);
+
+	if_initname(ifp, VIF_NAME, num);
 	ifp->if_softc = sc;
 
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;

Reply via email to