From patchwork Sat Nov 26 14:26:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1418 Return-Path: Received: from nm22-vm2.bullet.mail.ukl.yahoo.com (nm22-vm2.bullet.mail.ukl.yahoo.com [217.12.10.220]) by open-mesh.org (Postfix) with SMTP id 85B47600858 for ; Sat, 26 Nov 2011 15:30:17 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.216] by nm22.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 Received: from [77.238.184.74] by tm9.bullet.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 Received: from [127.0.0.1] by smtp143.mail.ukl.yahoo.com with NNFMP; 26 Nov 2011 14:30:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1322317817; bh=Yan5Ip+6SI9aKCLaCs+4U5j7ghVRSkB5d8Lc7ruPCxs=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=TPEkZP36CkkR/Zle1AYn+5hsRzp7pEGaV5ig6ZPYJhWCFS3vdbgfX7JtvaLvVVGBJadd4m39xPGpBRTHtDMn+1Y5LEFv9FM5YxMoZCTdckWxkVk5qKDn7WYfJp3fh0wvaiV74uPoTXacEit60pfldhuPGVdRJV5eVGvnrqmA5z4= X-Yahoo-Newman-Id: 95997.1773.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Q.JuNhMVM1mCyETsovbQeTIzHHY6k2n4_Esphy8nq5ZQhJM u2Awa_nvZL4kAPSIrLhdtbzyIVKZSR_DsB4Si9OXrFOXJQWwFrPQQ6nz.UtC lZetOiJyvnCsXycZXtcvtWZrEFglnsL09yXAxpkYSXA9Wkg3F8uLZ7q6cWdb YNu_5a_ALuwpvcuqVVbgrl_iZh.eyTvx6e0th3RXyL5kUfJqIhJUMQCNny2v qRSTf7KBJUb8OQnrrUa8hx.Wj5jMp88gplq5AExYw.NTnqLrykoWQmTbu0_v h.HB5eCKg.2WNCPoU_pGl9TVBhXPCa5ezDRtV3nqdCsokWsgqrxhk9K2UDB7 IIK8peBFeF15uI8sOB.6Q8NHzBhvZscx5uC8qBFYzI3gFVzRsZ2157g-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp143.mail.ukl.yahoo.com with SMTP; 26 Nov 2011 14:30:15 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Sat, 26 Nov 2011 22:26:50 +0800 Message-Id: <1322317612-7770-9-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> References: <1322317612-7770-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 08/10] batman-adv: linearise the tt_response skb only if needed X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 14:30:17 -0000 From: Antonio Quartulli The TT_RESPONSE skb has to be linearised only if the node plans to access the packet payload (so only if the message is directed to that node). In all the other cases the node can avoid this memory operation Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann --- net/batman-adv/routing.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 60ce407..e0e7b7b 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -616,13 +616,14 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) } break; case TT_RESPONSE: - /* packet needs to be linearized to access the TT changes */ - if (skb_linearize(skb) < 0) - goto out; + if (is_my_mac(tt_query->dst)) { + /* packet needs to be linearized to access the TT + * changes */ + if (skb_linearize(skb) < 0) + goto out; - if (is_my_mac(tt_query->dst)) handle_tt_response(bat_priv, tt_query); - else { + } else { bat_dbg(DBG_TT, bat_priv, "Routing TT_RESPONSE to %pM [%c]\n", tt_query->dst,