From patchwork Thu Jan 22 08:03:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 431691 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 2ABB6140216 for ; Thu, 22 Jan 2015 19:03:33 +1100 (AEDT) Received: from localhost ([::1]:51538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YECji-0000fW-W4 for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 03:03:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YECj9-0008BO-8L for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YECj2-0005Xc-LK for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:55 -0500 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:34344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YECj2-0005XW-EA for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:48 -0500 Received: by mail-pa0-f47.google.com with SMTP id lj1so247304pab.6 for ; Thu, 22 Jan 2015 00:02:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=7SMwYxkMtIiTMwHwTte+FCBNcEW58bOM5p73aGmNrGM=; b=y5wDbhMsAQl3mqH+eAsU2j2a/W3SdPvddUSEFBpl+wn+r9Z+yGCUANK32Ykm7q7t6s LWwOnS1nuF7fipAP6Jp7uyhKLAAOOHFZMR+43/I3RtMDdv2ToDCJ3r7q1f9PRtGKQwrO Xjj66gmdmnOx9f0lQdJnuphS+8T9I9IfJxyT7BRrQ/qhKMMip/oT2KKeEtXuBKCc+9mu WLEXIEa8J/whFQVNSKY5x9wyMBxEWU3mHkpXJhtei5xdGoLRBBMjiZzCpQeUSe3S6xQM 99GbPlZyEcYX5yNOxk4kS4Q58tPbaNZyYMKJeKb8oRKQZnPV8a+6gn1cD7MXxo5Kf4Q9 Puug== X-Received: by 10.66.62.229 with SMTP id b5mr285676pas.30.1421913767689; Thu, 22 Jan 2015 00:02:47 -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 le6sm8368368pab.33.2015.01.22.00.02.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 00:02:46 -0800 (PST) From: sfeldma@gmail.com To: qemu-devel@nongnu.org, jiri@resnulli.us, roopa@cumulusnetworks.com, john.fastabend@gmail.com, eblake@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, dsahern@gmail.com, jasowang@redhat.com Date: Thu, 22 Jan 2015 00:03:51 -0800 Message-Id: <1421913839-22448-3-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1421913839-22448-1-git-send-email-sfeldma@gmail.com> References: <1421913839-22448-1-git-send-email-sfeldma@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22f Subject: [Qemu-devel] [PATCH v5 02/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 Reviewed-by: Eric Blake --- 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 45da34a..698156f 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; }