]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/dccp/ipv4.c
net: use the macros defined for the members of flowi
[net-next-2.6.git] / net / dccp / ipv4.c
index d4a166f0f391d6bfccd85471b2616057d808c848..45a434f94169f13daf1addc73cdb809d77fae213 100644 (file)
@@ -392,7 +392,7 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
 
        newsk = dccp_create_openreq_child(sk, req, skb);
        if (newsk == NULL)
-               goto exit;
+               goto exit_nonewsk;
 
        sk_setup_caps(newsk, dst);
 
@@ -409,16 +409,20 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
 
        dccp_sync_mss(newsk, dst_mtu(dst));
 
+       if (__inet_inherit_port(sk, newsk) < 0) {
+               sock_put(newsk);
+               goto exit;
+       }
        __inet_hash_nolisten(newsk, NULL);
-       __inet_inherit_port(sk, newsk);
 
        return newsk;
 
 exit_overflow:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
+exit_nonewsk:
+       dst_release(dst);
 exit:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
-       dst_release(dst);
        return NULL;
 }
 
@@ -458,15 +462,12 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
 {
        struct rtable *rt;
        struct flowi fl = { .oif = skb_rtable(skb)->rt_iif,
-                           .nl_u = { .ip4_u =
-                                     { .daddr = ip_hdr(skb)->saddr,
-                                       .saddr = ip_hdr(skb)->daddr,
-                                       .tos = RT_CONN_FLAGS(sk) } },
+                           .fl4_dst = ip_hdr(skb)->saddr,
+                           .fl4_src = ip_hdr(skb)->daddr,
+                           .fl4_tos = RT_CONN_FLAGS(sk),
                            .proto = sk->sk_protocol,
-                           .uli_u = { .ports =
-                                      { .sport = dccp_hdr(skb)->dccph_dport,
-                                        .dport = dccp_hdr(skb)->dccph_sport }
-                                    }
+                           .fl_ip_sport = dccp_hdr(skb)->dccph_dport,
+                           .fl_ip_dport = dccp_hdr(skb)->dccph_sport
                          };
 
        security_skb_classify_flow(skb, &fl);