<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Important for pve?<br><br><br>Anfang der weitergeleiteten E‑Mail:<br><br></div><blockquote type="cite"><div><b>Von:</b> Paolo Bonzini <<a href="mailto:pbonzini@redhat.com">pbonzini@redhat.com</a>><br><b>Datum:</b> 22. März 2013 17:57:48 MEZ<br><b>An:</b> <a href="mailto:qemu-devel@nongnu.org">qemu-devel@nongnu.org</a><br><b>Kopie:</b> <a href="mailto:coreyb@linux.vnet.ibm.com">coreyb@linux.vnet.ibm.com</a>, <a href="mailto:qemu-stable@nongnu.org">qemu-stable@nongnu.org</a><br><b>Betreff:</b> <b>[Qemu-stable] [PATCH] qemu-bridge-helper: force usage of a very high MAC address for the bridge</b><br><br></div></blockquote><blockquote type="cite"><div><span>Linux uses the lowest enslaved MAC address as the MAC address of</span><br><span>the bridge.  Set MAC address to a high value so that it does not</span><br><span>affect the MAC address of the bridge.</span><br><span></span><br><span>Changing the MAC address of the bridge could cause a few seconds</span><br><span>of network downtime.</span><br><span></span><br><span>Cc: <a href="mailto:qemu-stable@nongnu.org">qemu-stable@nongnu.org</a></span><br><span>Signed-off-by: Paolo Bonzini <<a href="mailto:pbonzini@redhat.com">pbonzini@redhat.com</a>></span><br><span>---</span><br><span> qemu-bridge-helper.c | 18 ++++++++++++++++++</span><br><span> 1 file changed, 18 insertions(+)</span><br><span></span><br><span>diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c</span><br><span>index 287bfd5..6a0974e 100644</span><br><span>--- a/qemu-bridge-helper.c</span><br><span>+++ b/qemu-bridge-helper.c</span><br><span>@@ -367,6 +367,24 @@ int main(int argc, char **argv)</span><br><span>         goto cleanup;</span><br><span>     }</span><br><span></span><br><span>+    /* Linux uses the lowest enslaved MAC address as the MAC address of</span><br><span>+     * the bridge.  Set MAC address to a high value so that it doesn't</span><br><span>+     * affect the MAC address of the bridge.</span><br><span>+     */</span><br><span>+    if (ioctl(ctlfd, SIOCGIFHWADDR, &ifr) < 0) {</span><br><span>+        fprintf(stderr, "failed to get MAC address of device `%s': %s\n",</span><br><span>+                iface, strerror(errno));</span><br><span>+        ret = EXIT_FAILURE;</span><br><span>+        goto cleanup;</span><br><span>+    }</span><br><span>+    ifr.ifr_hwaddr.sa_data[0] = 0xFE;</span><br><span>+    if (ioctl(ctlfd, SIOCSIFHWADDR, &ifr) < 0) {</span><br><span>+        fprintf(stderr, "failed to set MAC address of device `%s': %s\n",</span><br><span>+                iface, strerror(errno));</span><br><span>+        ret = EXIT_FAILURE;</span><br><span>+        goto cleanup;</span><br><span>+    }</span><br><span>+</span><br><span>     /* add the interface to the bridge */</span><br><span>     prep_ifreq(&ifr, bridge);</span><br><span>     ifindex = if_nametoindex(iface);</span><br><span>-- </span><br><span>1.8.1.4</span><br><span></span><br><span></span><br></div></blockquote></body></html>