summaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 06:00:52 +0100
committerDavid S. Miller <davem@davemloft.net>2011-03-13 00:08:42 +0100
commit78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch)
tree9dccc5c16bf269d53d8499064ec95a998e84c646 /drivers/net/cnic.c
parentMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher... (diff)
downloadlinux-78fbfd8a653ca972afe479517a40661bfff6d8c3.tar.xz
linux-78fbfd8a653ca972afe479517a40661bfff6d8c3.zip
ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit in order to make changes to how flows are defined and used. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r--drivers/net/cnic.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 271a1f00c224..65832951fe07 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3407,20 +3407,14 @@ static int cnic_get_v4_route(struct sockaddr_in *dst_addr,
struct dst_entry **dst)
{
#if defined(CONFIG_INET)
- struct flowi fl;
- int err;
struct rtable *rt;
- memset(&fl, 0, sizeof(fl));
- fl.nl_u.ip4_u.daddr = dst_addr->sin_addr.s_addr;
-
- rt = ip_route_output_key(&init_net, &fl);
- err = 0;
- if (!IS_ERR(rt))
+ rt = ip_route_output(&init_net, dst_addr->sin_addr.s_addr, 0, 0, 0);
+ if (!IS_ERR(rt)) {
*dst = &rt->dst;
- else
- err = PTR_ERR(rt);
- return err;
+ return 0;
+ }
+ return PTR_ERR(rt);
#else
return -ENETUNREACH;
#endif