From patchwork Mon Jul 18 17:00:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 649646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rtTw31F81z9sR8 for ; Tue, 19 Jul 2016 03:01:07 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E7EDA1098A; Mon, 18 Jul 2016 10:00:47 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id BE3D810987 for ; Mon, 18 Jul 2016 10:00:46 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 462D3420A5A for ; Mon, 18 Jul 2016 11:00:46 -0600 (MDT) X-ASG-Debug-ID: 1468861245-09eadd26a849730001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id WwlKVUDdASPH17F8 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 18 Jul 2016 11:00:45 -0600 (MDT) X-Barracuda-Envelope-From: cascardo@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 18 Jul 2016 17:00:45 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87C133B720 for ; Mon, 18 Jul 2016 17:00:43 +0000 (UTC) Received: from indiana.gru.redhat.com (ovpn-116-31.phx2.redhat.com [10.3.116.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6IH0YQC005099 for ; Mon, 18 Jul 2016 13:00:42 -0400 X-CudaMail-Envelope-Sender: cascardo@redhat.com From: Thadeu Lima de Souza Cascardo To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-717027076 X-CudaMail-DTE: 071816 X-CudaMail-Originating-IP: 209.132.183.28 Date: Mon, 18 Jul 2016 14:00:23 -0300 X-ASG-Orig-Subj: [##CM-V2-717027076##][RFC 3/5] netdev-vport: don't use system type when opening netdev Message-Id: <1468861225-8569-4-git-send-email-cascardo@redhat.com> In-Reply-To: <1468861225-8569-1-git-send-email-cascardo@redhat.com> References: <1468861225-8569-1-git-send-email-cascardo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 18 Jul 2016 17:00:43 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1468861245 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [RFC 3/5] netdev-vport: don't use system type when opening netdev X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" tunnel_check_status_change__ calls netdev_open with type system. Using NULL instead will default to system in case the device is not opened yet, and allow a different type in case it's already opened. Any type should be fine, as netdev_get_carrier will work with any of them. --- lib/netdev-vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 83a795c..87a30f8 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -274,7 +274,7 @@ tunnel_check_status_change__(struct netdev_vport *netdev) if (ovs_router_lookup(route, iface, NULL, &gw)) { struct netdev *egress_netdev; - if (!netdev_open(iface, "system", &egress_netdev)) { + if (!netdev_open(iface, NULL, &egress_netdev)) { status = netdev_get_carrier(egress_netdev); netdev_close(egress_netdev); }