Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp220489pxb; Mon, 13 Sep 2021 17:30:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiIdeE7kKXrBU8eE44Sd5KIfBnOGDD9qxIZUDAlcLC4/9hmnuVITAH2tkSiBF+HXUs1iQV X-Received: by 2002:a17:906:e094:: with SMTP id gh20mr16377247ejb.252.1631579426468; Mon, 13 Sep 2021 17:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579426; cv=none; d=google.com; s=arc-20160816; b=YUCmgcNWwki3SFCc34ki9LstuXdHgaNlImMwTLX7YpLTDJEe6mW6RdDqsUF6RhY6qC mMnK5n8MhAB5epVK3qBknA1rJwnrloEn0U/gWmUXlflVQm+jUXeN62Kk22jupTcbMI9l cj7D1tK7FYiZEnNWrRhEGVhXPQH1kgG7J3Fakr4I1q0d0Ee+oCZ0wGAh8uqmCd+fQB5k 3pzGlRQkFfw2ALZVbvpAiknHu/j0qmIzcDvJolfRsGWEzXYF3Zot0xWjSoL7cxVixg+x MJ60vGJ6LemzSmkmUAPqvSiBA4cPi62b/03uNmaEhpZjAyI5iLjc6OI0l5fFrxzq1cF0 1Lug== 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=wZCwwgK55EaLtJDbbMTtIGuw+V1AOa9Y6J8sCHwhRiE=; b=e9RVKXSea5YAM4T49UBEaJWBTxCDLoE2wHw0+IXR7VBveQ3+9mKJJt6KU4GaiwJs0l dpLE/hWx/o3Mk/g/vy2mYtdH5UkWC85+zIrscc+F/CzzoyB3vE3At+LflH4NseOpR7v2 gBZVCFaXWCApN2ZpPozJx6Aao4oFfvkfSOkwpm120dZvc/wa73yXdpS9kpSp31RpK57M uQ+jII40KG+kesySTVkWfI9KWxklIht8qn/7xxG8wsvG6Yt4zLkYllcJn7ORxOrNC/KD zcQipcDyw7O0icwt1xBSUyILU8PaDwWmWNd6mkj6H/SlO99ZuNIMviA3RWbEmZ9VJv/z qFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GgCkwmVo; 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 g8si5583199edr.256.2021.09.13.17.30.03; Mon, 13 Sep 2021 17:30:26 -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=GgCkwmVo; 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 S243888AbhIMORG (ORCPT + 99 others); Mon, 13 Sep 2021 10:17:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244591AbhIMOOC (ORCPT ); Mon, 13 Sep 2021 10:14:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AAA9E6140A; Mon, 13 Sep 2021 13:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540610; bh=o6LKyrOM87VUXOgdhYXzpg42vafYxuwFSoEPoEO8Dt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgCkwmVoXKao8VoCFOv5yR+nPlFaYYeXRfLJ8YnFl8u8wHfEhyN5Fd07Pg3eU43sj UQo68KBQAI8iJL60RyVVMNKFzWunNndNaijpVNjgqmlNfszPKq6PFTwG5aPHMF8gW9 du1SG1vDx+HOtOv6eRfXvxshSrJoVD5cU9KVinGs= 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.13 262/300] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Date: Mon, 13 Sep 2021 15:15:23 +0200 Message-Id: <20210913131118.197055792@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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 70eba1c33fa4..f495fad73be9 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3061,7 +3061,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