From patchwork Sat Jun 11 20:27:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16371 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 1FC7681B38; Sat, 11 Jun 2016 22:28:23 +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=UMTyu4V5; 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 2749481946 for ; Sat, 11 Jun 2016 22:28:15 +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 5D3C91C8001; Sat, 11 Jun 2016 22:28:15 +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=1465676895; bh=DmItQtOeVe7qbGyKLKJcnxBJ5ILnxDSSzGavWbGT6Io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UMTyu4V5q7iwtQ2uiEwJCQBe2goR6a3MjmNje5dQclWYoX+RQ3d5PXpVk5K4KL0uN Xm7C1LLhp9s9JN41kPDUx7Wizmk9Cn1FGb4qYnweCdvk0pCbl2/Zg1uAiOkhhOsBJB d6pKC6CN8K7lfFV+/8YB6S9INtNbYSyJQrd5+MRw= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 11 Jun 2016 22:27:53 +0200 Message-Id: <1465676873-21545-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1465676873-21545-1-git-send-email-sven@narfation.org> References: <1465676873-21545-1-git-send-email-sven@narfation.org> Cc: a@unstable.cc Subject: [B.A.T.M.A.N.] [RFC 2/2] batman-adv: Use broadcast as fallback for gateway replies 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 replies from gateway server to gateway client are usually sent via unicast packets. This only works when the destination address for the reply is already known to the translation table. But usually the gateway replies are in response to the first known contact from a device to the gateway server. So it can happen that the TT entry was not yet created. The gateway server has therefore use broadcast as fallback when the entry is not yet known. This makes the first responses from a DHCP server to a DHCP client more robost. 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/soft-interface.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 216ac03..5829695 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -297,6 +297,18 @@ send: if (forw_mode == BATADV_FORW_SINGLE) do_bcast = false; } + + /* DHCP to from server to client should use unicast when TT + * entry is available and use broadcast as fallback + */ + if (!mcast_single_orig && dhcp_rcp == BATADV_DHCP_TO_CLIENT) { + mcast_single_orig = batadv_transtable_search(bat_priv, + NULL, + dst_hint, + vid); + if (!mcast_single_orig) + do_bcast = true; + } } batadv_skb_set_priority(skb, 0);