Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp92730pxb; Mon, 13 Sep 2021 13:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrqYCoqo4/LaeKL2q/48BhCNeaIMbtmjdWOjCy2feccbYavsOQvL4Zrs0jw/lKDRYUKffi X-Received: by 2002:a17:906:ae9b:: with SMTP id md27mr13523386ejb.380.1631566374286; Mon, 13 Sep 2021 13:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631566374; cv=none; d=google.com; s=arc-20160816; b=VDf95p443DU/dpTmTTgJgxYSOR6eEXAm7heZpVKNCuvyHq0HXam5AJDTOYkFTBxbJN o5CX5dUyHIUIDBQFfaxZHt3hcqgswDP2c5lOqS5I67/nL64IqxoEl8KY2Ls7MvSe1E1o /AOZF8lN0m9AjNi9un4Z9kZ+BS1cee8YUqUoG0SKpuO2I8o7+BYYzwdTHYEWrrWdiD1X hvfg8nBTP0PF9D2TUVbq6QRJ6WG6vx8ETnkxMA7y7kPshTK2x7xwHI3GhxKSxwNh6JpR mv7sFbCSvRxhu+kDOZAbYif42Puof+r+0UyxTUtdUanJlwY3elMwoR8CkVWJBLZR7LMO PaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4zT7SWKMZLIdCiSd9kkVZSUjsbIZu4AZ/rTiGDDmulQ=; b=lTFOZ+Fciwvg4cRGW5ZLZUlEdvqdp2crEC6uaGK3/mxowz7ENiwRIRKd5aNEMxu0EX 6zRjy+k043Rf85+ePeekFTsuvRkrCPQTQlNquOOKUec9wxkXtadiZoMzBWWb9RlMFn+O DMt8NO9I326NfgB41Zx32WK95yMWZkiN14Pt7Ll5peu7aM9Ogc0n40KyOuV0AElfOn+u BqILKaFdvjwvAmItrkANy2q5tATobHLWbGR11xPfCoZ9KT69BP1FR7vw7w1TZoVTR5Fk PZtF5J5hSdUo285Jt58hBmLRX9G+OBhvR0ojvJ5Be3x45fsrVFfmM57XFhnSmkK/0mG1 jWHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dm/4lAZU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hy2si9088710ejc.372.2021.09.13.13.52.30; Mon, 13 Sep 2021 13:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dm/4lAZU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244799AbhIMNu3 (ORCPT + 99 others); Mon, 13 Sep 2021 09:50:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242513AbhIMNql (ORCPT ); Mon, 13 Sep 2021 09:46:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0DC7661351; Mon, 13 Sep 2021 13:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539918; bh=u9mDsjAypRNOHz0EDPLzTs9k7otQqwNUEMTIFHf+clQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dm/4lAZUKQglTrdHx9qXRWSJ9IqiLq2lbTzc8NjQj/9OxrEYDBW0rENsET/B3fRrY TDwBjxiniIl/+GK20ktr2yh0UGlJLPd1cz2BBfGgScuiwVLJYIrS1SA2g0K3qQkjje /eUNly3Nq46btDv5VQcSYn9oJYm2oP5ZO7atqmaE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Roopa Prabhu , David Ahern , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 214/236] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Date: Mon, 13 Sep 2021 15:15:19 +0200 Message-Id: <20210913131107.649022423@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 92548b0ee220e000d81c27ac9a80e0ede895a881 ] The UDP length field should be in network order. This removes the following sparse error: net/ipv4/route.c:3173:27: warning: incorrect type in assignment (different base types) net/ipv4/route.c:3173:27: expected restricted __be16 [usertype] len net/ipv4/route.c:3173:27: got unsigned long Fixes: 404eb77ea766 ("ipv4: support sport, dport and ip_proto in RTM_GETROUTE") Signed-off-by: Eric Dumazet Cc: Roopa Prabhu Cc: David Ahern Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index c5d762a2be99..ce787c386793 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3078,7 +3078,7 @@ static struct sk_buff *inet_rtm_getroute_build_skb(__be32 src, __be32 dst, udph = skb_put_zero(skb, sizeof(struct udphdr)); udph->source = sport; udph->dest = dport; - udph->len = sizeof(struct udphdr); + udph->len = htons(sizeof(struct udphdr)); udph->check = 0; break; } -- 2.30.2