mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
ipv4: Make output route lookup return rtable directly.
Instead of on the stack. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
452edd598f
commit
b23dd4fe42
36 changed files with 267 additions and 224 deletions
|
|
@ -193,10 +193,11 @@ static int addr4_resolve(struct sockaddr_in *src_in,
|
|||
fl.nl_u.ip4_u.saddr = src_ip;
|
||||
fl.oif = addr->bound_dev_if;
|
||||
|
||||
ret = ip_route_output_key(&init_net, &rt, &fl);
|
||||
if (ret)
|
||||
rt = ip_route_output_key(&init_net, &fl);
|
||||
if (IS_ERR(rt)) {
|
||||
ret = PTR_ERR(rt);
|
||||
goto out;
|
||||
|
||||
}
|
||||
src_in->sin_family = AF_INET;
|
||||
src_in->sin_addr.s_addr = rt->rt_src;
|
||||
|
||||
|
|
|
|||
|
|
@ -354,7 +354,8 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
|
|||
}
|
||||
};
|
||||
|
||||
if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
|
||||
rt = ip_route_output_flow(&init_net, &fl, NULL);
|
||||
if (IS_ERR(rt))
|
||||
return NULL;
|
||||
return rt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,8 @@ static struct rtable *find_route(struct c4iw_dev *dev, __be32 local_ip,
|
|||
}
|
||||
};
|
||||
|
||||
if (ip_route_output_flow(&init_net, &rt, &fl, NULL))
|
||||
rt = ip_route_output_flow(&init_net, &fl, NULL);
|
||||
if (IS_ERR(rt))
|
||||
return NULL;
|
||||
return rt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1112,7 +1112,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
|
|||
|
||||
memset(&fl, 0, sizeof fl);
|
||||
fl.nl_u.ip4_u.daddr = htonl(dst_ip);
|
||||
if (ip_route_output_key(&init_net, &rt, &fl)) {
|
||||
rt = ip_route_output_key(&init_net, &fl);
|
||||
if (IS_ERR(rt)) {
|
||||
printk(KERN_ERR "%s: ip_route_output_key failed for 0x%08X\n",
|
||||
__func__, dst_ip);
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue