ipv4: Create and use route lookup helpers.
[linux-3.10.git] / drivers / infiniband / hw / cxgb4 / cm.c
index 77b0eef..97a876a 100644 (file)
@@ -315,23 +315,10 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
                                 __be16 peer_port, u8 tos)
 {
        struct rtable *rt;
-       struct flowi fl = {
-               .oif = 0,
-               .nl_u = {
-                        .ip4_u = {
-                                  .daddr = peer_ip,
-                                  .saddr = local_ip,
-                                  .tos = tos}
-                        },
-               .proto = IPPROTO_TCP,
-               .uli_u = {
-                         .ports = {
-                                   .sport = local_port,
-                                   .dport = peer_port}
-                         }
-       };
-
-       rt = ip_route_output_flow(&init_net, &fl, NULL);
+
+       rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip,
+                                  peer_port, local_port, IPPROTO_TCP,
+                                  tos, 0);
        if (IS_ERR(rt))
                return NULL;
        return rt;