From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 4ACF6C43381 for ; Fri, 8 Mar 2019 12:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1ADD62085A for ; Fri, 8 Mar 2019 12:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552049744; bh=NMmRWd60uI2k7MyEBJc15srcrY8oaYUy3I3NntViH24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Yhw29ScU6x7hChc6Tp5JSznD+NwNg9Hp5QARKBEJXWEA7u4n68hKyTgPIc4CYQdCN RLQFvnI+uj8FvOv7gAZz1krjRN/hUDnOHO+ROYWhEuI3ojteQI3+95gvyStYt9pXNz j0ESuBLPwkAziIU3/ZvnEp7dQ/ZxHld2lIqKVpjQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727551AbfCHMzm (ORCPT ); Fri, 8 Mar 2019 07:55:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:59722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727142AbfCHMzh (ORCPT ); Fri, 8 Mar 2019 07:55:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2472C2085A; Fri, 8 Mar 2019 12:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552049736; bh=NMmRWd60uI2k7MyEBJc15srcrY8oaYUy3I3NntViH24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsMoNXsFbKLIbdzeynjR7qchOT2JEQq0FfnGTBqDOddRR31luPs4/7HKU/w/Av9Hw VK/e2k+ClGfVTsDErcFG75ar7+qbqYFdGt+tS5/7rM26wS39GKn7GleT3Swvo83q/U Y6Y4eVoFpPJ2rKrWj6YHzWjfiMixh257HHEQwKQ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Nazarov , Paul Moore , "David S. Miller" Subject: [PATCH 4.20 49/76] net: Add __icmp_send helper. Date: Fri, 8 Mar 2019 13:50:01 +0100 Message-Id: <20190308124916.548932747@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190308124914.789210760@linuxfoundation.org> References: <20190308124914.789210760@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nazarov Sergey [ Upstream commit 9ef6b42ad6fd7929dd1b6092cb02014e382c6a91 ] Add __icmp_send function having ip_options struct parameter Signed-off-by: Sergey Nazarov Reviewed-by: Paul Moore Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/icmp.h | 9 ++++++++- net/ipv4/icmp.c | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) --- a/include/net/icmp.h +++ b/include/net/icmp.h @@ -22,6 +22,7 @@ #include #include +#include struct icmp_err { int errno; @@ -39,7 +40,13 @@ struct net_proto_family; struct sk_buff; struct net; -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info, + const struct ip_options *opt); +static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) +{ + __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt); +} + int icmp_rcv(struct sk_buff *skb); void icmp_err(struct sk_buff *skb, u32 info); int icmp_init(void); --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -570,7 +570,8 @@ relookup_failed: * MUST reply to only the first fragment. */ -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info, + const struct ip_options *opt) { struct iphdr *iph; int room; @@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, i iph->tos; mark = IP4_REPLY_MARK(net, skb_in->mark); - if (ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in)) + if (__ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in, opt)) goto out_unlock; @@ -742,7 +743,7 @@ out_bh_enable: local_bh_enable(); out:; } -EXPORT_SYMBOL(icmp_send); +EXPORT_SYMBOL(__icmp_send); static void icmp_socket_deliver(struct sk_buff *skb, u32 info)