1 From foo@baz Fri Mar 8 09:51:16 CET 2019
2 From: Nazarov Sergey <s-nazarov@yandex.ru>
3 Date: Mon, 25 Feb 2019 19:24:15 +0300
4 Subject: net: Add __icmp_send helper.
6 From: Nazarov Sergey <s-nazarov@yandex.ru>
8 [ Upstream commit 9ef6b42ad6fd7929dd1b6092cb02014e382c6a91 ]
10 Add __icmp_send function having ip_options struct parameter
12 Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru>
13 Reviewed-by: Paul Moore <paul@paul-moore.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 include/net/icmp.h | 9 ++++++++-
18 net/ipv4/icmp.c | 7 ++++---
19 2 files changed, 12 insertions(+), 4 deletions(-)
21 --- a/include/net/icmp.h
22 +++ b/include/net/icmp.h
25 #include <net/inet_sock.h>
31 @@ -39,7 +40,13 @@ struct net_proto_family;
35 -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
36 +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
37 + const struct ip_options *opt);
38 +static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
40 + __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
43 int icmp_rcv(struct sk_buff *skb);
44 void icmp_err(struct sk_buff *skb, u32 info);
48 @@ -541,7 +541,8 @@ relookup_failed:
49 * MUST reply to only the first fragment.
52 -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
53 +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
54 + const struct ip_options *opt)
58 @@ -655,7 +656,7 @@ void icmp_send(struct sk_buff *skb_in, i
60 mark = IP4_REPLY_MARK(net, skb_in->mark);
62 - if (ip_options_echo(&icmp_param->replyopts.opt.opt, skb_in))
63 + if (__ip_options_echo(&icmp_param->replyopts.opt.opt, skb_in, opt))
67 @@ -707,7 +708,7 @@ out_free:
71 -EXPORT_SYMBOL(icmp_send);
72 +EXPORT_SYMBOL(__icmp_send);
75 static void icmp_socket_deliver(struct sk_buff *skb, u32 info)