Message ID | 20200513094416.485631562@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=bVfs=63=vger.kernel.org=stable-owner@kernel.org> 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=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 8951CCA90AF for <stable@archiver.kernel.org>; Wed, 13 May 2020 10:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 657C820575 for <stable@archiver.kernel.org>; Wed, 13 May 2020 10:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589364129; bh=Ubz7VruHRIYMARfNxYnqVv5zsSbjW/xH3CYrn/L8SJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gUaLp70LnEPf2dlXjDcLUqUaFP3KoLUzAXbkr3lpep0uRfEDUuIJV1PBf5hdN/b0C JljVa1dnNjThf0ej4mO1xDAZo2oOCCIxN55gYNxtldMWOEpSpyJ7uyziFM9ifBlnhU 7EeR31cS07bAvpkQyN3cPy/dC33LjcyUPnoDCOgU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732886AbgEMKCF (ORCPT <rfc822;stable@archiver.kernel.org>); Wed, 13 May 2020 06:02:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:50268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387493AbgEMJu1 (ORCPT <rfc822;stable@vger.kernel.org>); Wed, 13 May 2020 05:50:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42C8F20740; Wed, 13 May 2020 09:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363426; bh=Ubz7VruHRIYMARfNxYnqVv5zsSbjW/xH3CYrn/L8SJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=caogtro+jjim67ybypyOO0PW6Py1xZp//n5Dd5cgfpPIlV11d5Q9ZT8LRv+sk9vqp n6mP+bLHNX78Eq4vxXv5Hpv/H+dFBZi042Bo8pkk6dOCnBi7vsakhaLD2SghBTL29A LmHVGnvhyN7tCx38SO3FhxWRzy3iBM+vp6Spg1pQ= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, George Spelvin <lkml@sdf.org>, Sven Eckelmann <sven@narfation.org>, Simon Wunderlich <sw@simonwunderlich.de> Subject: [PATCH 5.4 68/90] batman-adv: fix batadv_nc_random_weight_tq Date: Wed, 13 May 2020 11:45:04 +0200 Message-Id: <20200513094416.485631562@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094408.810028856@linuxfoundation.org> References: <20200513094408.810028856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c @@ -1009,15 +1009,8 @@ static struct batadv_nc_path *batadv_nc_ */ static u8 batadv_nc_random_weight_tq(u8 tq) { - u8 rand_val, rand_tq; - - get_random_bytes(&rand_val, sizeof(rand_val)); - /* randomize the estimated packet loss (max TQ - estimated TQ) */ - rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq); - - /* normalize the randomized packet loss */ - rand_tq /= BATADV_TQ_MAX_VALUE; + u8 rand_tq = prandom_u32_max(BATADV_TQ_MAX_VALUE + 1 - tq); /* convert to (randomized) estimated tq again */ return BATADV_TQ_MAX_VALUE - rand_tq;