]> xenbits.xensource.com Git - qemu-xen-4.3-testing.git/commitdiff
Remove duplicate copy of announce_self_create.
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 9 Jan 2009 11:59:37 +0000 (11:59 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 9 Jan 2009 11:59:37 +0000 (11:59 +0000)
In 73b0037b2278812fcadadec9d8eac656f1716074,
 `send arp like packets for hvm live migration',
another copy of announce_self_create was introduced.

We remove it in favour of the qemu upstream one, and shuffle a few
bits around to make the build work.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
vl.c

diff --git a/vl.c b/vl.c
index be6d9a285700724e64496b055c8bd756c883eb0c..1b30686b43b61ca7d6a98020849a4260561e65ba 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4576,28 +4576,11 @@ static int launch_script(const char *setup_script, const char *ifname, int fd)
     return 0;
 }
 
-#if defined(__linux__)
+static int announce_self_create(uint8_t *buf, 
+                               uint8_t *mac_addr);
 #define SELF_ANNOUNCE_ROUNDS 5
-#define ETH_P_EXPERIMENTAL 0x01F1 /* just a number in experimental range */
-#define EXPERIMENTAL_MAGIC 0xf1f23f4f
-static int announce_self_create(unsigned char *buf, 
-                         unsigned char mac_addr[ETH_ALEN])
-{
-    struct ethhdr *eh = (struct ethhdr*)buf;
-    uint32_t *magic   = (uint32_t*)(eh+1);
-    unsigned char *p  = (unsigned char*)(magic + 1);
-
-    /* ethernet header */
-    memset(eh->h_dest,   0xff,     ETH_ALEN);
-    memcpy(eh->h_source, mac_addr, ETH_ALEN);
-    eh->h_proto = htons(ETH_P_EXPERIMENTAL);
-
-    /* magic data */
-    *magic = EXPERIMENTAL_MAGIC;
-
-    return p - buf; /* sizeof(*eh) + sizeof(*magic) */
-}
 
+#if defined(__linux__)
 static void qemu_tap_announce_self(void)
 {
     int i, j, len;
@@ -6237,7 +6220,6 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque)
 }
 #endif
 
-#define SELF_ANNOUNCE_ROUNDS 5
 #define ETH_P_EXPERIMENTAL 0x01F1 /* just a number */
 //#define ETH_P_EXPERIMENTAL 0x0012 /* make it the size of the packet */
 #define EXPERIMENTAL_MAGIC 0xf1f23f4f