From patchwork Sat Jun 11 20:27:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16370 X-Patchwork-Delegate: a@unstable.cc 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 6006D8066D; Sat, 11 Jun 2016 22:28:15 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=UO2Cxo9H; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 2A61F80525 for ; Sat, 11 Jun 2016 22:28:13 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C3AEF90000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c3:aef9::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 9086C1C8001; Sat, 11 Jun 2016 22:28:12 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1465676892; bh=iFrY4bJuK5o7eJLh8QZDm6YcD+SnRzq8h5qfnwfnlbI=; h=From:To:Cc:Subject:Date:From; b=UO2Cxo9HIN6uuidVyBc68zza+QB7GFAoAb//f9TvpsSvwxETbDmhRJ3fHgCFtiTcw qssxGICc9Ct/Yj1JXp1+XBRShP30BRE6pptUL9YL+0Y4UYtSUfOqzbxngpFxrLQXKu 3I4fRKj0iIAjDUHKshryrmg8wld5/stuG+69WrX8= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 11 Jun 2016 22:27:52 +0200 Message-Id: <1465676873-21545-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 Cc: a@unstable.cc Subject: [B.A.T.M.A.N.] [RFC 1/2] batman-adv: Fix speedy join in gateway client mode 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" Speedy join only works when the received packet is either broadcast or an 4addr unicast packet. Thus packets converted from broadcast to unicast via the gateway handling code have to be converted to 4addr packets to allow the receiving gateway server to add the sender address as temporary node to the translation table. Not doing it will make batman-adv drop the DHCP response in many situations because it doesn't yet have the TT entry for the destination of the DHCP response. Signed-off-by: Sven Eckelmann --- This is completely untested. The RFC was submitted to better explain a problem to Antonio. This problems was noticed in real world setups but these patches were not yet tested in these setups. net/batman-adv/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index 49836da..0e9445b 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -426,8 +426,8 @@ int batadv_send_skb_via_gw(struct batadv_priv *bat_priv, struct sk_buff *skb, struct batadv_orig_node *orig_node; orig_node = batadv_gw_get_selected_orig(bat_priv); - return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0, - orig_node, vid); + return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST_4ADDR, + BATADV_P_DATA, orig_node, vid); } void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet)