* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix speedy join in gateway client mode
@ 2016-06-12 8:43 Sven Eckelmann
2016-06-12 8:43 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use broadcast as fallback for gateway replies Sven Eckelmann
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sven Eckelmann @ 2016-06-12 8:43 UTC (permalink / raw)
To: 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 entry
to the translation table.
Not doing it will make the batman-adv gateway server drop the DHCP response
in many situations because it doesn't yet have the TT entry for the
destination of the DHCP response.
Fixes: 9cbc67d9da47 ("batman-adv: change interface_rx to get orig node")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
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)
--
2.8.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use broadcast as fallback for gateway replies
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
2016-07-01 8:00 ` 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
2 siblings, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2016-06-12 8:43 UTC (permalink / raw)
To: 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix speedy join in gateway client mode
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 ` [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 ` Antonio Quartulli
2016-07-06 13:17 ` Marek Lindner
2 siblings, 0 replies; 5+ messages in thread
From: Antonio Quartulli @ 2016-07-06 13:11 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
[-- Attachment #1: Type: text/plain, Size: 802 bytes --]
On Sun, Jun 12, 2016 at 10:43:19AM +0200, Sven Eckelmann wrote:
> 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 entry
> to the translation table.
>
> Not doing it will make the batman-adv gateway server drop the DHCP response
> in many situations because it doesn't yet have the TT entry for the
> destination of the DHCP response.
>
> Fixes: 9cbc67d9da47 ("batman-adv: change interface_rx to get orig node")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Antonio Quartulli <a@unstable.cc>
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix speedy join in gateway client mode
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 ` [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
2 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2016-07-06 13:17 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 842 bytes --]
On Sunday, June 12, 2016 10:43:19 Sven Eckelmann wrote:
> 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 entry
> to the translation table.
>
> Not doing it will make the batman-adv gateway server drop the DHCP response
> in many situations because it doesn't yet have the TT entry for the
> destination of the DHCP response.
>
> Fixes: 9cbc67d9da47 ("batman-adv: change interface_rx to get orig node")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> net/batman-adv/send.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied in revision 12c771d.
Thanks,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-06 13:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Use broadcast as fallback for gateway replies Sven Eckelmann
2016-07-01 8:00 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox