From patchwork Fri Sep 30 13:21:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16711 X-Patchwork-Delegate: sw@simonwunderlich.de 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 1AF5F82FE2; Fri, 30 Sep 2016 15:21:14 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=UrvYoewU; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=2a00:1450:400c:c09::232; helo=mail-wm0-x232.google.com; envelope-from=sven.eckelmann@open-mesh.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) by open-mesh.org (Postfix) with ESMTPS id 3F20282FAF for ; Fri, 30 Sep 2016 15:21:12 +0200 (CEST) Received: by mail-wm0-x232.google.com with SMTP id b4so47171174wmb.0 for ; Fri, 30 Sep 2016 06:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5pztFcCzfNFRETthEtJPHHbCtJU3xcFmeXuB8bhjiaE=; b=UrvYoewU7gtJ0vwg1GzL6xUVcu6abrH0oTnYk6mdj2lShaDCBQLWsZskElX0ZnfpPt aR7afzG+PreAtpMD0yS7V1wWBT+nu2X7E9mEGUPvloU5XangPmqtwq7iL8D5Qutd1+/r cwGVI78tF9OoUzZM/S0COclEHiv5dJRWkP6URhv8l1Ub1DTLgE9cszBtpYVPYd3fDvXi bWy5q1mkdxGVpjalO0U/GfXWuMTCKFOI6wvjuJR78vs3ZizKchLYNlOxgEhASNiwZnzq /GoDSBhNWeMCIbHnbyMSCJy9gAKr4t+ZUBrOIcV9n+9xOIzwDqQZJnbSSl5Jj7yXDpJ5 pzcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5pztFcCzfNFRETthEtJPHHbCtJU3xcFmeXuB8bhjiaE=; b=ky+LxBh9rP4+t8uCFQqGouqIgzUDC1PpczHLoRmU/9v93dyyx5GGoJ74FkeXs8NttN nEvC44vmbuvxF0/RpKCuL/BxfBEg5XJVhwygvKDutdy/NA3dT//L6CKxL7rCpslvtl1H ifTBJhqWHwPUCOIiq/6wTFbpoVdzQJWDgVNEgKVZaQebUit5xarNICD0T7DaEkkOX69C B0uFbPD5RJrBhCjSgOcOVBvKw2qxcNOiOCkW9UZFkip/LScVbiCDI0OyoBcx6HZ7sF7D D2Ro6ONuP1PKueCB5Lh5gt7gcE+usXA5SjBJq4MsA3OCXUZrwwGDhMRRU+kzMMnh4o+M JP6A== X-Gm-Message-State: AA6/9Rl1aOPX/uH+sXtZ4evKoEGUWZFQJwulwqPsa760ANV7wJUK6XvR+GfPLdrl0egDz5F4 X-Received: by 10.194.62.212 with SMTP id a20mr3559611wjs.180.1475241671854; Fri, 30 Sep 2016 06:21:11 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p2003007C6F5097FECB62B7744C7C7C8D.dip0.t-ipconnect.de. [2003:7c:6f50:97fe:cb62:b774:4c7c:7c8d]) by smtp.gmail.com with ESMTPSA id c5sm19529522wjw.29.2016.09.30.06.21.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Sep 2016 06:21:11 -0700 (PDT) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 30 Sep 2016 15:21:00 +0200 Message-Id: <20160930132106.5798-1-sven.eckelmann@open-mesh.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <2666783.nl87Kib46y@bentobox> References: <2666783.nl87Kib46y@bentobox> Cc: Sven Eckelmann Subject: [B.A.T.M.A.N.] [PATCH v2 1/7] batman-adv: Return non-const ptr in batadv_getlink_net 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" The returned net_namespace of batadv_getlink_net may be used with functions that potentially modify the struct. Thus it must return the pointer as non-const like rtnl_link_ops::get_link_net does. Signed-off-by: Sven Eckelmann --- v2: - new patch --- net/batman-adv/hard-interface.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 08ce361..a0b01cb 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -92,8 +92,8 @@ out: * * Return: result of rtnl_link_ops->get_link_net or @fallback_net */ -static const struct net *batadv_getlink_net(const struct net_device *netdev, - const struct net *fallback_net) +static struct net *batadv_getlink_net(const struct net_device *netdev, + struct net *fallback_net) { if (!netdev->rtnl_link_ops) return fallback_net; @@ -116,9 +116,9 @@ static const struct net *batadv_getlink_net(const struct net_device *netdev, * Return: true if the devices are each others parent, otherwise false */ static bool batadv_mutual_parents(const struct net_device *dev1, - const struct net *net1, + struct net *net1, const struct net_device *dev2, - const struct net *net2) + struct net *net2) { int dev1_parent_iflink = dev_get_iflink(dev1); int dev2_parent_iflink = dev_get_iflink(dev2); @@ -154,7 +154,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev) { struct net *net = dev_net(net_dev); struct net_device *parent_dev; - const struct net *parent_net; + struct net *parent_net; bool ret; /* check if this is a batman-adv mesh interface */