summary refs log tree commit diff stats
path: root/net/announce.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/announce.c')
-rw-r--r--net/announce.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/announce.c b/net/announce.c
index 26f057f5ee..3b9e2f1f14 100644
--- a/net/announce.c
+++ b/net/announce.c
@@ -120,6 +120,19 @@ static int announce_self_create(uint8_t *buf,
     return 60; /* len (FCS will be added by hardware) */
 }
 
+/*
+ * Helper to print ethernet mac address
+ */
+static const char *qemu_ether_ntoa(const MACAddr *mac)
+{
+    static char ret[18];
+
+    snprintf(ret, sizeof(ret), "%02x:%02x:%02x:%02x:%02x:%02x",
+             mac->a[0], mac->a[1], mac->a[2], mac->a[3], mac->a[4], mac->a[5]);
+
+    return ret;
+}
+
 static void qemu_announce_self_iter(NICState *nic, void *opaque)
 {
     AnnounceTimer *timer = opaque;