]> err.no Git - linux-2.6/blobdiff - net/ipv6/udp.c
ocfs2: Unlock mutex in local alloc failure case
[linux-2.6] / net / ipv6 / udp.c
index d1fbddd172e76c277625254641e59ae884488f0a..c347f3e30e2e5ef1ccd3469f6f2ab804649402c4 100644 (file)
 
 DEFINE_SNMP_STAT(struct udp_mib, udp_stats_in6) __read_mostly;
 
-static int ipv6_rcv_saddr_any(const struct sock *sk)
-{
-       struct ipv6_pinfo *np = inet6_sk(sk);
-
-       return ipv6_addr_any(&np->rcv_saddr);
-}
-
-static unsigned int ipv6_hash_port_and_rcv_saddr(__u16 port,
-                                                const struct sock *sk)
-{
-       return port;
-}
-
-const struct udp_get_port_ops udp_ipv6_ops = {
-       .saddr_cmp = ipv6_rcv_saddr_equal,
-       .saddr_any = ipv6_rcv_saddr_any,
-       .hash_port_and_rcv_saddr = ipv6_hash_port_and_rcv_saddr,
-};
-
 static inline int udp_v6_get_port(struct sock *sk, unsigned short snum)
 {
-       return udp_get_port(sk, snum, &udp_ipv6_ops);
+       return udp_get_port(sk, snum, ipv6_rcv_saddr_equal);
 }
 
 static struct sock *__udp6_lib_lookup(struct in6_addr *saddr, __be16 sport,
@@ -574,6 +555,8 @@ static int udp_v6_push_pending_frames(struct sock *sk)
 out:
        up->len = 0;
        up->pending = 0;
+       if (!err)
+               UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, up->pcflag);
        return err;
 }
 
@@ -842,10 +825,8 @@ do_append_data:
        release_sock(sk);
 out:
        fl6_sock_release(flowlabel);
-       if (!err) {
-               UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite);
+       if (!err)
                return len;
-       }
        /*
         * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space.  Reporting
         * ENOBUFS might not be good (it's not tunable per se), but otherwise