aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-03-13 21:09:26 -0700
committerStefan Hajnoczi <stefanha@redhat.com>2015-05-11 14:49:03 +0100
commitb0575ba4a52c9259357af29d842950e978306fa4 (patch)
tree8f2f1862907f9bc0e4010916e9ffe8021f6e0ed5
parent890ee6abb385d6508bba7f5273c74a8e43bea6af (diff)
downloadqemu-b0575ba4a52c9259357af29d842950e978306fa4.zip
qemu-b0575ba4a52c9259357af29d842950e978306fa4.tar.gz
qemu-b0575ba4a52c9259357af29d842950e978306fa4.tar.bz2
virtio-net: use qemu_mac_strdup_printf
Signed-off-by: Scott Feldman <sfeldma@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1426306173-24884-3-git-send-email-sfeldma@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--hw/net/virtio-net.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 67ab228..9829ad0 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -226,12 +226,6 @@ static void rxfilter_notify(NetClientState *nc)
}
}
-static char *mac_strdup_printf(const uint8_t *mac)
-{
- return g_strdup_printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[0],
- mac[1], mac[2], mac[3], mac[4], mac[5]);
-}
-
static intList *get_vlan_table(VirtIONet *n)
{
intList *list, *entry;
@@ -284,12 +278,12 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc)
info->multicast_overflow = n->mac_table.multi_overflow;
info->unicast_overflow = n->mac_table.uni_overflow;
- info->main_mac = mac_strdup_printf(n->mac);
+ info->main_mac = qemu_mac_strdup_printf(n->mac);
str_list = NULL;
for (i = 0; i < n->mac_table.first_multi; i++) {
entry = g_malloc0(sizeof(*entry));
- entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
+ entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
entry->next = str_list;
str_list = entry;
}
@@ -298,7 +292,7 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc)
str_list = NULL;
for (i = n->mac_table.first_multi; i < n->mac_table.in_use; i++) {
entry = g_malloc0(sizeof(*entry));
- entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
+ entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN);
entry->next = str_list;
str_list = entry;
}