struct dst_entry;
 struct net_proto_family;
 struct sk_buff;
+struct net;
 
 extern void    icmp_send(struct sk_buff *skb_in,  int type, int code, __be32 info);
 extern int     icmp_rcv(struct sk_buff *skb);
 extern int     icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
 extern int     icmp_init(void);
-extern void    icmp_out_count(unsigned char type);
+extern void    icmp_out_count(struct net *net, unsigned char type);
 
 /* Move into dst.h ? */
 extern int     xrlim_allow(struct dst_entry *dst, int timeout);
 
 /*
  *     Maintain the counters used in the SNMP statistics for outgoing ICMP
  */
-void icmp_out_count(unsigned char type)
+void icmp_out_count(struct net *net, unsigned char type)
 {
        ICMPMSGOUT_INC_STATS(type);
        ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
 
        struct sk_buff *skb, *tmp_skb;
        struct sk_buff **tail_skb;
        struct inet_sock *inet = inet_sk(sk);
+       struct net *net = sock_net(sk);
        struct ip_options *opt = NULL;
        struct rtable *rt = (struct rtable *)inet->cork.dst;
        struct iphdr *iph;
        skb->dst = dst_clone(&rt->u.dst);
 
        if (iph->protocol == IPPROTO_ICMP)
-               icmp_out_count(((struct icmphdr *)
+               icmp_out_count(net, ((struct icmphdr *)
                        skb_transport_header(skb))->type);
 
        /* Netfilter gets whole the not fragmented skb. */
 
                        unsigned int flags)
 {
        struct inet_sock *inet = inet_sk(sk);
+       struct net *net = sock_net(sk);
        struct iphdr *iph;
        struct sk_buff *skb;
        unsigned int iphlen;
                iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
        }
        if (iph->protocol == IPPROTO_ICMP)
-               icmp_out_count(((struct icmphdr *)
+               icmp_out_count(net, ((struct icmphdr *)
                        skb_transport_header(skb))->type);
 
        err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev,