Merge branch 'pandora-27-omap1' into rev2
[pandora-kernel.git] / net / ipv6 / icmp.c
index d42dd16..b3157a0 100644 (file)
@@ -5,8 +5,6 @@
  *     Authors:
  *     Pedro Roque             <roque@di.fc.ul.pt>
  *
- *     $Id: icmp.c,v 1.38 2002/02/08 03:57:19 davem Exp $
- *
  *     Based on net/ipv4/icmp.c
  *
  *     RFC 1885
@@ -93,19 +91,22 @@ static struct inet6_protocol icmpv6_protocol = {
        .flags          =       INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
 };
 
-static __inline__ int icmpv6_xmit_lock(struct sock *sk)
+static __inline__ struct sock *icmpv6_xmit_lock(struct net *net)
 {
+       struct sock *sk;
+
        local_bh_disable();
 
+       sk = icmpv6_sk(net);
        if (unlikely(!spin_trylock(&sk->sk_lock.slock))) {
                /* This can happen if the output path (f.e. SIT or
                 * ip6ip6 tunnel) signals dst_link_failure() for an
                 * outgoing ICMP6 packet.
                 */
                local_bh_enable();
-               return 1;
+               return NULL;
        }
-       return 0;
+       return sk;
 }
 
 static __inline__ void icmpv6_xmit_unlock(struct sock *sk)
@@ -394,11 +395,10 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
        fl.fl_icmp_code = code;
        security_skb_classify_flow(skb, &fl);
 
-       sk = icmpv6_sk(net);
-       np = inet6_sk(sk);
-
-       if (icmpv6_xmit_lock(sk))
+       sk = icmpv6_xmit_lock(net);
+       if (sk == NULL)
                return;
+       np = inet6_sk(sk);
 
        if (!icmpv6_xrlim_allow(sk, type, &fl))
                goto out;
@@ -541,11 +541,10 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
        fl.fl_icmp_type = ICMPV6_ECHO_REPLY;
        security_skb_classify_flow(skb, &fl);
 
-       sk = icmpv6_sk(net);
-       np = inet6_sk(sk);
-
-       if (icmpv6_xmit_lock(sk))
+       sk = icmpv6_xmit_lock(net);
+       if (sk == NULL)
                return;
+       np = inet6_sk(sk);
 
        if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst))
                fl.oif = np->mcast_oif;
@@ -956,7 +955,8 @@ ctl_table ipv6_icmp_table_template[] = {
                .data           = &init_net.ipv6.sysctl.icmpv6_time,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = &proc_dointvec_ms_jiffies,
+               .strategy       = &sysctl_ms_jiffies
        },
        { .ctl_name = 0 },
 };