SHA256
1
0
forked from pool/qemu
qemu/0036-Legacy-Patch-kvm-qemu-preXX-report-.patch
Alexander Graf 91a548c8b1 - Cherry pick patches from qemu-kvm into the qemu package:
- 0033-Add-support-for-DictZip-enabled-gzi.patch
   - 0034-Add-tar-container-format.patch.patch
   - 0035-Legacy-Patch-kvm-qemu-preXX-dictzip.patch
   - 0036-Legacy-Patch-kvm-qemu-preXX-report-.patch
   - 0037-console-add-question-mark-escape-op.patch
   - 0038-Make-char-muxer-more-robust-wrt-sma.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=124
2012-12-13 10:49:19 +00:00

50 lines
1.4 KiB
Diff

From fba5b73038a98aa1fd602ed3f7bc5c09026afd4a Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Wed, 12 Dec 2012 19:11:31 +0100
Subject: [PATCH] Legacy Patch kvm-qemu-preXX-report-default-mac-used.patch
---
net.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/net.c b/net.c
index e8ae13e..e181e50 100644
--- a/net.c
+++ b/net.c
@@ -138,6 +138,27 @@ void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6])
macaddr[3], macaddr[4], macaddr[5]);
}
+static void default_mac_check(void)
+{
+ static const MACAddr def_mac = { .a = { 0x52,0x54,0x00,0x12,0x34,0x56 } };
+ static int warned = 0;
+ int i;
+
+ for (i = 0; i < MAX_NICS; i++)
+ {
+ if (!nd_table[i].used)
+ continue;
+ if (memcmp(nd_table[i].macaddr.a, def_mac.a, 5))
+ continue;
+ if (nd_table[i].macaddr.a[5] >= 0x56 &&
+ nd_table[i].macaddr.a[5] < 0x56 + MAX_NICS && !warned) {
+ warned = 1;
+ fprintf(stderr, "Warning: default mac address being used, creating "
+ "potential for address conflict\n");
+ }
+ }
+}
+
void qemu_macaddr_default_if_unset(MACAddr *macaddr)
{
static int index = 0;
@@ -1010,6 +1031,7 @@ int net_init_clients(void)
if (qemu_opts_foreach(net, net_init_client, NULL, 1) == -1) {
return -1;
}
+ default_mac_check();
return 0;
}