fixed mconsole when using multiple guests

fixed interface enumeration bug
This commit is contained in:
Martin Willi
2007-07-25 14:05:06 +00:00
parent f85fdda835
commit 53b0f3c3b3
3 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ static char* create_tap(private_iface_t *this)
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (ioctl(this->tap, TUNSETIFF, &ifr) < 0 ||
ioctl(this->tap, TUNSETPERSIST, 1) < 0)
ioctl(this->tap, TUNSETPERSIST, 1) < 0 ||
ioctl(this->tap, TUNSETOWNER, 0))
{
DBG1("creating new tap device failed: %m");
return NULL;
+1
View File
@@ -225,6 +225,7 @@ static void guest(dumm_t *dumm, char *name)
if (streq(name, guest->get_name(guest)))
{
found = TRUE;
break;
}
}
iterator->destroy(iterator);
+1 -1
View File
@@ -154,7 +154,7 @@ mconsole_t *mconsole_create(char *sock)
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
sprintf(&addr.sun_path[1], "%5d", getpid());
sprintf(&addr.sun_path[1], "%5d-%s", getpid(), sock);
if (bind(this->socket, (struct sockaddr*)&addr, sizeof(addr)) < 0)
{
DBG1("binding mconsole socket failed: %m");