Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2567984lkm; Mon, 20 Sep 2021 18:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8qwRqn4UdiqKtVhnEC0ii+yhfaKP9YGqTo86Hevb8P87gqMXy1s7eoPjYmH8HeaOou6H6 X-Received: by 2002:a92:db0b:: with SMTP id b11mr19539129iln.275.1632188924286; Mon, 20 Sep 2021 18:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188924; cv=none; d=google.com; s=arc-20160816; b=vCI00PF7+npDggM2Ez83c1iVVhcLexvPmwkYebHvz549WkRqRwe0zXvQk58BEywBN5 yDA+U+nc2ZewyYLwT+mG9yoll20pCknD1kFPhpXnjZ3ACaqLF0mmicbxKkJf7QKs+3vt KQcP2PX0FiVmhrOvXDqpOx+RcLQ7P/WmtmoE+uJ3BM0bcgiEVXT9HlqPxyQ2l8zMUPn7 lSPh3IxUZryntHNxEdPPzcnZxpvTESG+Oc3kYIq4rembPBvfJAiAjSkzqHrx3BvTTvBi g3C2lKA134ryT9aNJzZT8NIs3QhsyNOQ/157dn6CFE47v/TligCraTa2XpR2YBDMLThT bj4A== 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=NsDsnAkXvONfduVl3OUZoTlIo12/hbYAFQfOYMZm9Ws=; b=mkE95Gmybz7fNOarNkjsaXc+ufttfDico4r4d+9pPJOJB2pI/zv/yK9pKTFujYcDNH WPjKHl3+uq+4bGgqdSvO3jD/nWLkAoXlzNh5HL5NMO6ZHFxmgpD3HrKxN3UlKSclOXB5 ruVTij3/b0ECX9GPIVduShdiFCOeRP8RoW4d5vXB+RE9bKJofOb5MvNB6YW56ScyB5qD FkgfuJg53iXDzgbTfsZAT9bb1ONNgx0CeRkhlSPBLJVxeJRegzpvleiOGU9nz7/5Avpa rBGzV8LhhXHm0CAgpnMadFCiBYH2ne/m3r636GQEpFarAzb6xv7XwkbCjFlqNS8cUF4c KdaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LL20G5BN; 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 d10si7016205ilu.50.2021.09.20.18.48.33; Mon, 20 Sep 2021 18:48:44 -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=LL20G5BN; 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 S1349101AbhITRn6 (ORCPT + 99 others); Mon, 20 Sep 2021 13:43:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:48734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352759AbhITRlk (ORCPT ); Mon, 20 Sep 2021 13:41:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E9E1261B63; Mon, 20 Sep 2021 17:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157722; bh=ZRg9tBO70UphgkvhuQCuYQVfzIBZWJPP6hkwL1qnChA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LL20G5BN5fDZZOYFh7m42RhwWUF7TccQJjKkEA5k/6AHztiI3o7+aG2u3FypBDUo7 zBkRRHv1WColaecxl2G4EFwg/6LAiQRx3iPlT6I+SAzoSKeZ2ytiRHiRlqq+eKNL6l PcdPDJLgZjDqqHzF/cqKgjtmihkyMvlpD8SnSIY4= 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 4.19 104/293] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Date: Mon, 20 Sep 2021 18:41:06 +0200 Message-Id: <20210920163936.818194608@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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 d72bffab6ffc..730a15fc497c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2815,7 +2815,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