diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-02-24 15:11:39 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-22 14:46:17 +0400 |
commit | 8a166615a49de80234aa14ae4e830b4a3cc9da6d (patch) | |
tree | d833929323838dc8fc65347f1e540ecb46e1e4a8 /net | |
parent | 5933dd9576e9be2053598f4fad88f2406d72a85c (diff) |
util: remove the net/net.h dependency
Move qemu_ether_ntoa() which is only needed in net/.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/announce.c | 13 |
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; |