From patchwork Sun Oct 16 18:32:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1283 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id 35AEE6007BB for ; Sun, 16 Oct 2011 20:33:05 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [217.150.252.179] (confino [217.150.252.179]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 779C5C8646; Sun, 16 Oct 2011 18:33:03 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org 779C5C8646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1318789984; bh=Zt+dbTPze1xyX8qcqskYolSRcwH/+WK1zsVoMNU0gYI=; h=From:To:Cc:Subject:Date:Message-Id; b=azAy2ZO13lqw26xbBa39BVsfPLltiWx7q/YZMqyg0a4mEOvieRpgZxQGuYiFs1ddy dNQxp4c7pLENcFOeaBCMkyuhjLRRpfHhRp+oiuOVUVAbzhX+fZa93fV93laBaA860f dhBo1LBzuF9EPlLryJGccKqs53g+UHvYtt9taLP4= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 16 Oct 2011 20:32:02 +0200 Message-Id: <1318789923-29405-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCHv3 1/3] 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: Sun, 16 Oct 2011 18:33:05 -0000 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 --- routing.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/routing.c b/routing.c index 60ce407..e0e7b7b 100644 --- a/routing.c +++ b/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,