Fix device name clash in src/veth.c

This commit is contained in:
Dan Smith 2008-08-07 13:34:17 +00:00
parent 7846f71fb3
commit e94c12451b
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Thu Aug 7 06:32:05 PDT 2008 Dan Smith <danms@us.ibm.com>
* src/veth.c: Fix assigned device name clash
Wed Aug 7 15:02:06 CEST 2008 Jim Meyering <meyering@redhat.com>
add the mkstemp module from gnulib

View File

@ -92,17 +92,18 @@ int vethCreate(char* veth1, int veth1MaxLen,
DEBUG("veth1: %s veth2: %s", veth1, veth2);
if (1 > strlen(veth1)) {
while ((1 > strlen(veth1)) || STREQ(veth1, veth2)) {
vethDev = getFreeVethName(veth1, veth1MaxLen, 0);
++vethDev;
DEBUG("assigned veth1: %s", veth1);
}
if (1 > strlen(veth2)) {
while ((1 > strlen(veth2)) || STREQ(veth1, veth2)) {
vethDev = getFreeVethName(veth2, veth2MaxLen, vethDev);
DEBUG("assigned veth2: %s", veth2);
}
DEBUG("veth1: %s veth2: %s", veth1, veth2);
rc = virRun(NULL, (char**)argv, &cmdResult);
if (0 == rc) {