From patchwork Mon Mar 16 22:30:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 229376 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 DE532C4CECE for ; Mon, 16 Mar 2020 22:31:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B193720663 for ; Mon, 16 Mar 2020 22:31:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="iOaPMJ42" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732828AbgCPWb1 (ORCPT ); Mon, 16 Mar 2020 18:31:27 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:49378 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732825AbgCPWb1 (ORCPT ); Mon, 16 Mar 2020 18:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1584397885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ed6eKVXLOnh+aiqtZTszepKOkAAPp3x3KHW9nohPnB4=; b=iOaPMJ42krP0T2/bSuO6wp/H7f5viZyHbl4/Pi1Si7kjeHrmUINKRZsj6L21SdlolbW5hC VLzUg+Mpo2bPXxtPgOnN5b99IVHT7zuuFceFyRWRW4CE+8n5jaF/VwGCa7CV2CnGDF+WvS 9syLHhj7YFCgG7HaIRucIrI+8ixMOMg= From: Sven Eckelmann To: stable@vger.kernel.org Cc: =?utf-8?q?Linus_L=C3=BCssing?= , Sven Eckelmann , Simon Wunderlich Subject: [PATCH 4.9 18/24] batman-adv: Avoid storing non-TT-sync flags on singular entries too Date: Mon, 16 Mar 2020 23:30:59 +0100 Message-Id: <20200316223105.6333-19-sven@narfation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316223105.6333-1-sven@narfation.org> References: <20200316223105.6333-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 From: Linus Lüssing commit 4a519b83da16927fb98fd32b0f598e639d1f1859 upstream. Since commit 54e22f265e87 ("batman-adv: fix TT sync flag inconsistencies") TT sync flags and TT non-sync'd flags are supposed to be stored separately. The previous patch missed to apply this separation on a TT entry with only a single TT orig entry. This is a minor fix because with only a single TT orig entry the DDoS issue the former patch solves does not apply. Fixes: 54e22f265e87 ("batman-adv: fix TT sync flag inconsistencies") Signed-off-by: Linus Lüssing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/translation-table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 7323b50535ad..6300454a4014 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1708,7 +1708,8 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv, ether_addr_copy(common->addr, tt_addr); common->vid = vid; - common->flags = flags; + common->flags = flags & (~BATADV_TT_SYNC_MASK); + tt_global_entry->roam_at = 0; /* node must store current time in case of roaming. This is * needed to purge this entry out on timeout (if nobody claims