From patchwork Tue Nov 1 14:38:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Sarton X-Patchwork-Id: 16799 Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id D53B4831C1; Tue, 1 Nov 2016 15:41:33 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=none header.from=t-online.de Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) by open-mesh.org (Postfix) with ESMTPS id 6E8B7831C1 for ; Tue, 1 Nov 2016 15:38:55 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=none header.from=t-online.de Received: from fwd31.aul.t-online.de (fwd31.aul.t-online.de [172.20.26.136]) by mailout05.t-online.de (Postfix) with SMTP id EDB81423CE59 for ; Tue, 1 Nov 2016 15:38:54 +0100 (CET) Received: from pc3.jjsarton.de (ZGmCmuZdZhrnYdDU+jOAdeeiu2q-fP1QLNFAors3g1v1CTo6n5nrGz9Jfj+zGaWgYV@[109.75.223.223]) by fwd31.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1c1aDB-0KBRZo0; Tue, 1 Nov 2016 15:38:49 +0100 To: b.a.t.m.a.n@lists.open-mesh.org From: Jean-Jacques Sarton Openpgp: id=F1A7034CEF4FAA67C999A7B033D25B891DC2C10B Message-ID: Date: Tue, 1 Nov 2016 15:38:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 X-ID: ZGmCmuZdZhrnYdDU+jOAdeeiu2q-fP1QLNFAors3g1v1CTo6n5nrGz9Jfj+zGaWgYV X-TOI-MSGID: ebcbd108-d1ce-4b78-adcd-336b13e0f1fc X-Mailman-Approved-At: Tue, 01 Nov 2016 15:41:31 +0100 Subject: [B.A.T.M.A.N.] PATCH alfred X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Copy & paste is not allways the right way. The previous patch for netlink.c what not OK. The right patch is: + return 0; +} diff --git a/netlink.c b/netlink.c index 1b5695c..445161d 100644 --- a/netlink.c +++ b/netlink.c @@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const struct ether_addr *mac, return 0; } + +int batadv_interface_check_netlink(const char *mesh_iface) +{ + struct get_tq_netlink_opts opts = { + .tq = 0, + .found = false, + .query_opts = { + .err = 0, + }, + }; + int ret = 0; + + memset(&opts.mac, 0, ETH_ALEN); + + ret = netlink_query_common(mesh_iface, BATADV_CMD_GET_ORIGINATORS, + get_tq_netlink_cb, &opts.query_opts); + if (ret < 0) + return ret; + + memset(&opts.mac, 0, ETH_ALEN); + ret = netlink_query_common(mesh_iface, BATADV_CMD_GET_TRANSTABLE_GLOBAL, + get_tq_netlink_cb, &opts.query_opts); + + if (ret < 0) + return ret;