Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp45355pxb; Mon, 13 Sep 2021 12:30:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN8X55o7zuz98kYeJotpHUGKA50pTtT4k6IN7xLpBT6NvpodMKw3rYSKhhn7/WKl3gHnd3 X-Received: by 2002:aa7:cd79:: with SMTP id ca25mr15097223edb.389.1631561406353; Mon, 13 Sep 2021 12:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631561406; cv=none; d=google.com; s=arc-20160816; b=WVM02/u4gqtQprAluDI9cL7DtW7k9EIjy34nqvtjZ4FmpM/myUjAPtVWtg3kZ62cKS W6sHDMhtcWNZBLHkuqa10C2UyiynvBmwPZgpAeu9DWXvdjcmUm/7CCddoP4ZrpwEiDd9 0Fb9P7H05GSkU0128GZXhJG010mx0crLxZyhnWVOrLKX54smnS7ozm3j427fXRezFI+P H6mYbr/9R2Na+B1SZgwnBnwnsVT/iEpLcrwfStLxSff0lJxT8+Kz6jptcVDDNACQWm1d z0V7vhKr26EOuaIEL49DOsf6cIGaU0PlsNoOu4pJLnnjJPAandBCU+kQv8hHy/QtB7x+ NFZg== 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=+76NzhTX2FImrBV26OKQstNAhxWPMyGJYVR5H0tcUpE=; b=VWYUp5ukbarmNm5+FnB4p0BgqNnbT78GCUDa9knYWVHk6rtPMYNPkQoM8Rt0wJ+aDt FOpYGJKis2HCPn401fYxMsww7rwQNafLNLxyXxR+C5DzqZ1581eWe62yON/jgy8siLmo NF005ulUNI6WUerawRgmP2yw3Q+ww5Ghko+KG71iYDpebQ8we0Ko3dLYpsqSGxmZk/ZM D4Ls805rVbN3lda+H3BgFth6DAurYlNQeq1NGXgxELsBQgNieOpUpq105n7Q34kNnoGz vRfcmRbmh/i33WfKuLSDdagB7kto9S8xueUjKLhrGdfjWk7CQ4dxvdfhvheFZr+phkVg sSfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iJfwZNaO; 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 b15si10550383edm.218.2021.09.13.12.29.42; Mon, 13 Sep 2021 12:30:06 -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=iJfwZNaO; 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 S242084AbhIMNai (ORCPT + 99 others); Mon, 13 Sep 2021 09:30:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:46964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242189AbhIMN1x (ORCPT ); Mon, 13 Sep 2021 09:27:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 80C4161264; Mon, 13 Sep 2021 13:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539393; bh=dg2QN3AWCIWmVz2nrFCFnJUi6tR7PcdlkYoww0kPG3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJfwZNaOroKU+LfPUWD4gaaq74tcQZrcS9iDdZa7Y/91Yw01VITCbPNPAmxNlBIQU X+IMhzLooyAbh0XdN4u4VLpj+FAwgmytH6hiG470K2DZ4S6Go9k+Rq/yeYgaTu7O7u Rc3SLllx/1k4U7faWFMOxWF/zppUFeluBwZsEc14= 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.4 126/144] ipv4: fix endianness issue in inet_rtm_getroute_build_skb() Date: Mon, 13 Sep 2021 15:15:07 +0200 Message-Id: <20210913131052.141914548@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 03f35764a40e..539492998864 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3004,7 +3004,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