From patchwork Tue May 11 11:34:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12250749 X-Patchwork-Delegate: kuba@kernel.org Return-Path: 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 62840C433ED for ; Tue, 11 May 2021 11:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 476676186A for ; Tue, 11 May 2021 11:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbhEKLft (ORCPT ); Tue, 11 May 2021 07:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbhEKLft (ORCPT ); Tue, 11 May 2021 07:35:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD2FC061574; Tue, 11 May 2021 04:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=z8xth38edps4ercvMCzw87sEignsU1bmAbE1Z2XXkMo=; b=r18c6FH0bQlv+AXcu0qPDkQona PXwtIcOpBUP1r4eVHMQB3L78lthcIk6qHQUiMQjk3W02GsVW2ZeNweBq0TZtHsg5hAp++wAiMV/Ho pkICVhaXwD+crN3+Y9QH7WJ/VZgYoqBgPQHc3/HWXVJAGw/0ihmNrfQxJN4WIPZy94FYQ4amC1o74 j8w6Lz+ulFThH5AYXrzmlHJQWi/6DCD3l7T3D0RA0Oozo0xLVEcHs/zFaCOeu4OUtO1vw8Z97o1Mc f3agHWPGUZHWXdtpriIJwfAbejid0l7FwMjQRM15W0Xr4MpubxUQr+WTOQ1ALhseL37gBUN25xoJb Tmgdk/lQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lgQeL-007EFh-Po; Tue, 11 May 2021 11:34:13 +0000 From: "Matthew Wilcox (Oracle)" To: davem@davemloft.net, kuba@kernel.org, yoshfuji@linux-ipv6.org, dsahern@kernel.org Cc: "Matthew Wilcox (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Abeni , Eric Dumazet Subject: [PATCH] udp: Switch the order of arguments to copy_linear_skb Date: Tue, 11 May 2021 12:34:00 +0100 Message-Id: <20210511113400.1722975-1-willy@infradead.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org All other skb functions use (off, len); this is the only one which uses (len, off). Make it consistent. Cc: Paolo Abeni Cc: Eric Dumazet Signed-off-by: Matthew Wilcox (Oracle) --- include/net/udp.h | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/udp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/udp.h b/include/net/udp.h index 360df454356c..c4a7a4c56e75 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -392,7 +392,7 @@ static inline bool udp_skb_is_linear(struct sk_buff *skb) } #endif -static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, +static inline int copy_linear_skb(struct sk_buff *skb, int off, int len, struct iov_iter *to) { int n; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 15f5504adf5b..783c466e6071 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1859,7 +1859,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, if (checksum_valid || udp_skb_csum_unnecessary(skb)) { if (udp_skb_is_linear(skb)) - err = copy_linear_skb(skb, copied, off, &msg->msg_iter); + err = copy_linear_skb(skb, off, copied, &msg->msg_iter); else err = skb_copy_datagram_msg(skb, off, msg, copied); } else { diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 199b080d418a..24b202dd370e 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -369,7 +369,7 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, if (checksum_valid || udp_skb_csum_unnecessary(skb)) { if (udp_skb_is_linear(skb)) - err = copy_linear_skb(skb, copied, off, &msg->msg_iter); + err = copy_linear_skb(skb, off, copied, &msg->msg_iter); else err = skb_copy_datagram_msg(skb, off, msg, copied); } else {