Commit 9ef6b42a authored by Nazarov Sergey's avatar Nazarov Sergey Committed by David S. Miller

net: Add __icmp_send helper.

Add __icmp_send function having ip_options struct parameter
Signed-off-by: default avatarSergey Nazarov <s-nazarov@yandex.ru>
Reviewed-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ecef67cb
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <net/inet_sock.h> #include <net/inet_sock.h>
#include <net/snmp.h> #include <net/snmp.h>
#include <net/ip.h>
struct icmp_err { struct icmp_err {
int errno; int errno;
...@@ -39,7 +40,13 @@ struct net_proto_family; ...@@ -39,7 +40,13 @@ struct net_proto_family;
struct sk_buff; struct sk_buff;
struct net; 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); int icmp_rcv(struct sk_buff *skb);
int icmp_err(struct sk_buff *skb, u32 info); int icmp_err(struct sk_buff *skb, u32 info);
int icmp_init(void); int icmp_init(void);
......
...@@ -570,7 +570,8 @@ static struct rtable *icmp_route_lookup(struct net *net, ...@@ -570,7 +570,8 @@ static struct rtable *icmp_route_lookup(struct net *net,
* MUST reply to only the first fragment. * 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; struct iphdr *iph;
int room; int room;
...@@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) ...@@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
iph->tos; iph->tos;
mark = IP4_REPLY_MARK(net, skb_in->mark); 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; goto out_unlock;
...@@ -742,7 +743,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) ...@@ -742,7 +743,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
local_bh_enable(); local_bh_enable();
out:; out:;
} }
EXPORT_SYMBOL(icmp_send); EXPORT_SYMBOL(__icmp_send);
static void icmp_socket_deliver(struct sk_buff *skb, u32 info) static void icmp_socket_deliver(struct sk_buff *skb, u32 info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment