aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/icmp.h3
-rw-r--r--net/ipv4/icmp.c2
-rw-r--r--net/ipv4/ip_output.c3
-rw-r--r--net/ipv4/raw.c3
4 files changed, 7 insertions, 4 deletions
diff --git a/include/net/icmp.h b/include/net/icmp.h
index dddb839ff4b..38ca2f39db7 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -44,12 +44,13 @@ DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
44struct dst_entry; 44struct dst_entry;
45struct net_proto_family; 45struct net_proto_family;
46struct sk_buff; 46struct sk_buff;
47struct net;
47 48
48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 49extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
49extern int icmp_rcv(struct sk_buff *skb); 50extern int icmp_rcv(struct sk_buff *skb);
50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 51extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
51extern int icmp_init(void); 52extern int icmp_init(void);
52extern void icmp_out_count(unsigned char type); 53extern void icmp_out_count(struct net *net, unsigned char type);
53 54
54/* Move into dst.h ? */ 55/* Move into dst.h ? */
55extern int xrlim_allow(struct dst_entry *dst, int timeout); 56extern int xrlim_allow(struct dst_entry *dst, int timeout);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index aa7cf46853b..1ffe7add492 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -296,7 +296,7 @@ out:
296/* 296/*
297 * Maintain the counters used in the SNMP statistics for outgoing ICMP 297 * Maintain the counters used in the SNMP statistics for outgoing ICMP
298 */ 298 */
299void icmp_out_count(unsigned char type) 299void icmp_out_count(struct net *net, unsigned char type)
300{ 300{
301 ICMPMSGOUT_INC_STATS(type); 301 ICMPMSGOUT_INC_STATS(type);
302 ICMP_INC_STATS(ICMP_MIB_OUTMSGS); 302 ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index f1278eecf56..f003186b93b 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1211,6 +1211,7 @@ int ip_push_pending_frames(struct sock *sk)
1211 struct sk_buff *skb, *tmp_skb; 1211 struct sk_buff *skb, *tmp_skb;
1212 struct sk_buff **tail_skb; 1212 struct sk_buff **tail_skb;
1213 struct inet_sock *inet = inet_sk(sk); 1213 struct inet_sock *inet = inet_sk(sk);
1214 struct net *net = sock_net(sk);
1214 struct ip_options *opt = NULL; 1215 struct ip_options *opt = NULL;
1215 struct rtable *rt = (struct rtable *)inet->cork.dst; 1216 struct rtable *rt = (struct rtable *)inet->cork.dst;
1216 struct iphdr *iph; 1217 struct iphdr *iph;
@@ -1280,7 +1281,7 @@ int ip_push_pending_frames(struct sock *sk)
1280 skb->dst = dst_clone(&rt->u.dst); 1281 skb->dst = dst_clone(&rt->u.dst);
1281 1282
1282 if (iph->protocol == IPPROTO_ICMP) 1283 if (iph->protocol == IPPROTO_ICMP)
1283 icmp_out_count(((struct icmphdr *) 1284 icmp_out_count(net, ((struct icmphdr *)
1284 skb_transport_header(skb))->type); 1285 skb_transport_header(skb))->type);
1285 1286
1286 /* Netfilter gets whole the not fragmented skb. */ 1287 /* Netfilter gets whole the not fragmented skb. */
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 925fdf18cf9..7f39ea443ec 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -320,6 +320,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
320 unsigned int flags) 320 unsigned int flags)
321{ 321{
322 struct inet_sock *inet = inet_sk(sk); 322 struct inet_sock *inet = inet_sk(sk);
323 struct net *net = sock_net(sk);
323 struct iphdr *iph; 324 struct iphdr *iph;
324 struct sk_buff *skb; 325 struct sk_buff *skb;
325 unsigned int iphlen; 326 unsigned int iphlen;
@@ -368,7 +369,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
368 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 369 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
369 } 370 }
370 if (iph->protocol == IPPROTO_ICMP) 371 if (iph->protocol == IPPROTO_ICMP)
371 icmp_out_count(((struct icmphdr *) 372 icmp_out_count(net, ((struct icmphdr *)
372 skb_transport_header(skb))->type); 373 skb_transport_header(skb))->type);
373 374
374 err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 375 err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev,