public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use broadcast as fallback for gateway replies
Date: Sun, 12 Jun 2016 10:43:20 +0200	[thread overview]
Message-ID: <1465721000-9174-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1465721000-9174-1-git-send-email-sven@narfation.org>

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 robust.

Fixes: 2d5b555644b2 ("batman-adv: send every DHCP packet as bat-unicast")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 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);
-- 
2.8.1


  reply	other threads:[~2016-06-12  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-12  8:43 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix speedy join in gateway client mode Sven Eckelmann
2016-06-12  8:43 ` Sven Eckelmann [this message]
2016-07-01  8:00   ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use broadcast as fallback for gateway replies Sven Eckelmann
2016-07-06 13:11 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix speedy join in gateway client mode Antonio Quartulli
2016-07-06 13:17 ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465721000-9174-2-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox