From patchwork Tue Mar 17 23:27:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 229169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78F0BC5ACD8 for ; Tue, 17 Mar 2020 23:28:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F77E20674 for ; Tue, 17 Mar 2020 23:28:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="MfiYSg9d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727085AbgCQX2G (ORCPT ); Tue, 17 Mar 2020 19:28:06 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:53676 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgCQX2G (ORCPT ); Tue, 17 Mar 2020 19:28:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1584487685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LRrKgK9fh4urpEALxvTXoznInhijHzPIStPv3WQxS4I=; b=MfiYSg9d81ovYAeFad4+gS4cVSguFWdilzMyNpuuj01jc+qIsd4YqIPLesltBajTen8oWR JPjrM5cIlu/ose9bpGwMqkT3i//okXmH/pjGJ9mJITp5eeAF0TGhJdHeU+L8STxO6nKWjL 2OKxOSaZTS4wcIUaAxUCTX639oq7iio= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , Antonio Quartulli , Marek Lindner , Simon Wunderlich Subject: [PATCH 4.4 23/48] batman-adv: Fix speedy join in gateway client mode Date: Wed, 18 Mar 2020 00:27:09 +0100 Message-Id: <20200317232734.6127-24-sven@narfation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200317232734.6127-1-sven@narfation.org> References: <20200317232734.6127-1-sven@narfation.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit d1fe176ca51fa3cb35f70c1d876d9a090e9befce upstream. 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: 371351731e9c ("batman-adv: change interface_rx to get orig node") Signed-off-by: Sven Eckelmann Acked-by: Antonio Quartulli Signed-off-by: Marek Lindner Signed-off-by: Simon Wunderlich --- 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 0e0c3b8ed927..11fbfb222c49 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c @@ -381,8 +381,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_schedule_bat_ogm(struct batadv_hard_iface *hard_iface)