]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.18.137/net-add-__icmp_send-helper.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.137 / net-add-__icmp_send-helper.patch
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.
5
6 From: Nazarov Sergey <s-nazarov@yandex.ru>
7
8 [ Upstream commit 9ef6b42ad6fd7929dd1b6092cb02014e382c6a91 ]
9
10 Add __icmp_send function having ip_options struct parameter
11
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>
16 ---
17 include/net/icmp.h | 9 ++++++++-
18 net/ipv4/icmp.c | 7 ++++---
19 2 files changed, 12 insertions(+), 4 deletions(-)
20
21 --- a/include/net/icmp.h
22 +++ b/include/net/icmp.h
23 @@ -22,6 +22,7 @@
24
25 #include <net/inet_sock.h>
26 #include <net/snmp.h>
27 +#include <net/ip.h>
28
29 struct icmp_err {
30 int errno;
31 @@ -39,7 +40,13 @@ struct net_proto_family;
32 struct sk_buff;
33 struct net;
34
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)
39 +{
40 + __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
41 +}
42 +
43 int icmp_rcv(struct sk_buff *skb);
44 void icmp_err(struct sk_buff *skb, u32 info);
45 int icmp_init(void);
46 --- a/net/ipv4/icmp.c
47 +++ b/net/ipv4/icmp.c
48 @@ -541,7 +541,8 @@ relookup_failed:
49 * MUST reply to only the first fragment.
50 */
51
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)
55 {
56 struct iphdr *iph;
57 int room;
58 @@ -655,7 +656,7 @@ void icmp_send(struct sk_buff *skb_in, i
59 iph->tos;
60 mark = IP4_REPLY_MARK(net, skb_in->mark);
61
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))
64 goto out_unlock;
65
66
67 @@ -707,7 +708,7 @@ out_free:
68 kfree(icmp_param);
69 out:;
70 }
71 -EXPORT_SYMBOL(icmp_send);
72 +EXPORT_SYMBOL(__icmp_send);
73
74
75 static void icmp_socket_deliver(struct sk_buff *skb, u32 info)