mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 14:07:16 +00:00
Fix device name clash in src/veth.c
This commit is contained in:
parent
7846f71fb3
commit
e94c12451b
@ -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>
|
Wed Aug 7 15:02:06 CEST 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
add the mkstemp module from gnulib
|
add the mkstemp module from gnulib
|
||||||
|
@ -92,17 +92,18 @@ int vethCreate(char* veth1, int veth1MaxLen,
|
|||||||
|
|
||||||
DEBUG("veth1: %s veth2: %s", veth1, veth2);
|
DEBUG("veth1: %s veth2: %s", veth1, veth2);
|
||||||
|
|
||||||
if (1 > strlen(veth1)) {
|
while ((1 > strlen(veth1)) || STREQ(veth1, veth2)) {
|
||||||
vethDev = getFreeVethName(veth1, veth1MaxLen, 0);
|
vethDev = getFreeVethName(veth1, veth1MaxLen, 0);
|
||||||
++vethDev;
|
++vethDev;
|
||||||
DEBUG("assigned veth1: %s", veth1);
|
DEBUG("assigned veth1: %s", veth1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 > strlen(veth2)) {
|
while ((1 > strlen(veth2)) || STREQ(veth1, veth2)) {
|
||||||
vethDev = getFreeVethName(veth2, veth2MaxLen, vethDev);
|
vethDev = getFreeVethName(veth2, veth2MaxLen, vethDev);
|
||||||
DEBUG("assigned veth2: %s", veth2);
|
DEBUG("assigned veth2: %s", veth2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEBUG("veth1: %s veth2: %s", veth1, veth2);
|
||||||
rc = virRun(NULL, (char**)argv, &cmdResult);
|
rc = virRun(NULL, (char**)argv, &cmdResult);
|
||||||
|
|
||||||
if (0 == rc) {
|
if (0 == rc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user