|
Daniel P. Berrange |
206300 |
diff -rupN libvirt-0.4.1.orig/src/bridge.c libvirt-0.4.1.new/src/bridge.c
|
|
Daniel P. Berrange |
206300 |
--- libvirt-0.4.1.orig/src/bridge.c 2008-02-28 06:16:21.000000000 -0500
|
|
Daniel P. Berrange |
206300 |
+++ libvirt-0.4.1.new/src/bridge.c 2008-03-13 11:25:12.000000000 -0400
|
|
Daniel P. Berrange |
206300 |
@@ -313,7 +313,6 @@ brDeleteInterface(brControl *ctl ATTRIBU
|
|
Daniel P. Berrange |
206300 |
int
|
|
Daniel P. Berrange |
206300 |
brAddTap(brControl *ctl,
|
|
Daniel P. Berrange |
206300 |
const char *bridge,
|
|
Daniel P. Berrange |
206300 |
- unsigned char *macaddr,
|
|
Daniel P. Berrange |
206300 |
char *ifname,
|
|
Daniel P. Berrange |
206300 |
int maxlen,
|
|
Daniel P. Berrange |
206300 |
int *tapfd)
|
|
Daniel P. Berrange |
206300 |
@@ -357,18 +356,6 @@ brAddTap(brControl *ctl,
|
|
Daniel P. Berrange |
206300 |
}
|
|
Daniel P. Berrange |
206300 |
|
|
Daniel P. Berrange |
206300 |
if (ioctl(fd, TUNSETIFF, &try) == 0) {
|
|
Daniel P. Berrange |
206300 |
- struct ifreq addr;
|
|
Daniel P. Berrange |
206300 |
- memset(&addr, 0, sizeof(addr));
|
|
Daniel P. Berrange |
206300 |
- memcpy(addr.ifr_hwaddr.sa_data, macaddr, 6);
|
|
Daniel P. Berrange |
206300 |
- addr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
|
|
Daniel P. Berrange |
206300 |
-
|
|
Daniel P. Berrange |
206300 |
- /* Device actually starts in 'UP' state, but it
|
|
Daniel P. Berrange |
206300 |
- * needs to be down to set the MAC addr
|
|
Daniel P. Berrange |
206300 |
- */
|
|
Daniel P. Berrange |
206300 |
- if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 0)))
|
|
Daniel P. Berrange |
206300 |
- goto error;
|
|
Daniel P. Berrange |
206300 |
- if (ioctl(fd, SIOCSIFHWADDR, &addr) != 0)
|
|
Daniel P. Berrange |
206300 |
- goto error;
|
|
Daniel P. Berrange |
206300 |
if ((errno = brAddInterface(ctl, bridge, try.ifr_name)))
|
|
Daniel P. Berrange |
206300 |
goto error;
|
|
Daniel P. Berrange |
206300 |
if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 1)))
|
|
Daniel P. Berrange |
206300 |
diff -rupN libvirt-0.4.1.orig/src/bridge.h libvirt-0.4.1.new/src/bridge.h
|
|
Daniel P. Berrange |
206300 |
--- libvirt-0.4.1.orig/src/bridge.h 2008-02-28 06:16:21.000000000 -0500
|
|
Daniel P. Berrange |
206300 |
+++ libvirt-0.4.1.new/src/bridge.h 2008-03-13 11:25:12.000000000 -0400
|
|
Daniel P. Berrange |
206300 |
@@ -62,7 +62,6 @@ int brDeleteInterface (brContr
|
|
Daniel P. Berrange |
206300 |
|
|
Daniel P. Berrange |
206300 |
int brAddTap (brControl *ctl,
|
|
Daniel P. Berrange |
206300 |
const char *bridge,
|
|
Daniel P. Berrange |
206300 |
- unsigned char *mac,
|
|
Daniel P. Berrange |
206300 |
char *ifname,
|
|
Daniel P. Berrange |
206300 |
int maxlen,
|
|
Daniel P. Berrange |
206300 |
int *tapfd);
|
|
Daniel P. Berrange |
206300 |
diff -rupN libvirt-0.4.1.orig/src/qemu_conf.c libvirt-0.4.1.new/src/qemu_conf.c
|
|
Daniel P. Berrange |
206300 |
--- libvirt-0.4.1.orig/src/qemu_conf.c 2008-03-13 11:24:39.000000000 -0400
|
|
Daniel P. Berrange |
206300 |
+++ libvirt-0.4.1.new/src/qemu_conf.c 2008-03-13 11:25:12.000000000 -0400
|
|
Daniel P. Berrange |
206300 |
@@ -1540,7 +1540,6 @@ qemudNetworkIfaceConnect(virConnectPtr c
|
|
Daniel P. Berrange |
206300 |
}
|
|
Daniel P. Berrange |
206300 |
|
|
Daniel P. Berrange |
206300 |
if ((err = brAddTap(driver->brctl, brname,
|
|
Daniel P. Berrange |
206300 |
- net->mac,
|
|
Daniel P. Berrange |
206300 |
ifname, BR_IFNAME_MAXLEN, &tapfd))) {
|
|
Daniel P. Berrange |
206300 |
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
|
Daniel P. Berrange |
206300 |
"Failed to add tap interface '%s' to bridge '%s' : %s",
|
|
Daniel P. Berrange |
206300 |
@@ -1548,7 +1547,9 @@ qemudNetworkIfaceConnect(virConnectPtr c
|
|
Daniel P. Berrange |
206300 |
goto error;
|
|
Daniel P. Berrange |
206300 |
}
|
|
Daniel P. Berrange |
206300 |
|
|
Daniel P. Berrange |
206300 |
- snprintf(tapfdstr, sizeof(tapfdstr), "tap,fd=%d,script=,vlan=%d", tapfd, vlan);
|
|
Daniel P. Berrange |
206300 |
+ snprintf(tapfdstr, sizeof(tapfdstr),
|
|
Daniel P. Berrange |
206300 |
+ "tap,fd=%d,script=,vlan=%d,ifname=%s",
|
|
Daniel P. Berrange |
206300 |
+ tapfd, vlan, ifname);
|
|
Daniel P. Berrange |
206300 |
|
|
Daniel P. Berrange |
206300 |
if (!(retval = strdup(tapfdstr)))
|
|
Daniel P. Berrange |
206300 |
goto no_memory;
|