From patchwork Tue Dec 30 05:14:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 424549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F0EB21400B7 for ; Tue, 30 Dec 2014 17:47:34 +1100 (AEDT) Received: from localhost ([::1]:35877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5qab-0005wT-6e for incoming@patchwork.ozlabs.org; Tue, 30 Dec 2014 01:47:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5p7M-0007vS-N7 for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5p7E-0004SD-04 for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:16 -0500 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]:59841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5p7D-0004S9-On for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:07 -0500 Received: by mail-pd0-f171.google.com with SMTP id y13so18641220pdi.30 for ; Mon, 29 Dec 2014 21:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=4rjt5oWe3DY8g3+OsbCYp4B2bprqnmomfPyjyA2aR+M=; b=crXumu/Km5k9wdD19XMMPpKFwaiyxzYY6ESlQNXVNfJrfOTIdC3GIFpP8xo+M2tGB+ lLkrJAlP8gYoxtmnKLMaiconGmpffh50kT/L3NDGygguJxcGzpZyigUtduZ6W0N2C+wx GOl4FTxgo1KoObi5PMS81XEICGbcXo1S9VbNJiIoLyFXBXIRXhQaklirN4XSQigu0LFQ olpDtkI8ptD7ccYy5zJ/P8skBOyk3mGuk74Fe5f59NGdzko2tFBFe5w1UKDh/OEG9o35 fgfntampATg3DnRA7o0iCJoHe+IcFEyhXY4QqgUPumzuwA3b7lna2NQeTOjaP/jF28YR BX8Q== X-Received: by 10.70.52.33 with SMTP id q1mr92489366pdo.64.1419916387159; Mon, 29 Dec 2014 21:13:07 -0800 (PST) Received: from rocker1.home (static-50-53-122-54.bvtn.or.frontiernet.net. [50.53.122.54]) by mx.google.com with ESMTPSA id uq15sm37400803pab.8.2014.12.29.21.13.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Dec 2014 21:13:06 -0800 (PST) From: sfeldma@gmail.com To: qemu-devel@nongnu.org, jiri@resnulli.us, roopa@cumulusnetworks.com, john.fastabend@gmail.com Date: Mon, 29 Dec 2014 21:14:04 -0800 Message-Id: <1419916451-49258-4-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22b X-Mailman-Approved-At: Tue, 30 Dec 2014 01:43:15 -0500 Subject: [Qemu-devel] [PATCH 03/10] virtio-net: use qemu_mac_strdup_printf X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Scott Feldman Signed-off-by: Scott Feldman --- hw/net/virtio-net.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index e574bd4..9afe669 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; }