From: Ian Jackson Date: Fri, 9 Jan 2009 11:59:37 +0000 (+0000) Subject: Remove duplicate copy of announce_self_create. X-Git-Tag: t.master-before-merge~32^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a61846ca32238279dedfbf069cf4b8cf0aa380a5;p=qemu-xen-4.3-testing.git Remove duplicate copy of announce_self_create. 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 --- diff --git a/vl.c b/vl.c index be6d9a285..1b30686b4 100644 --- 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