[1/2] batman-adv: Fix speedy join in gateway client mode

Message ID 1465721000-9174-1-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Delegated to: Marek Lindner
Headers

Commit Message

Sven Eckelmann June 12, 2016, 8:43 a.m. UTC
  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(-)
  

Comments

Antonio Quartulli July 6, 2016, 1:11 p.m. UTC | #1
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>
  
Marek Lindner July 6, 2016, 1:17 p.m. UTC | #2
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
  

Patch

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)