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>
This commit is contained in:
@@ -98,12 +98,7 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
|
||||
spin_lock(&dest->dst_lock);
|
||||
if (!(rt = (struct rtable *)
|
||||
__ip_vs_dst_check(dest, rtos))) {
|
||||
struct flowi fl = {
|
||||
.fl4_dst = dest->addr.ip,
|
||||
.fl4_tos = rtos,
|
||||
};
|
||||
|
||||
rt = ip_route_output_key(net, &fl);
|
||||
rt = ip_route_output(net, dest->addr.ip, 0, rtos, 0);
|
||||
if (IS_ERR(rt)) {
|
||||
spin_unlock(&dest->dst_lock);
|
||||
IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
|
||||
@@ -117,12 +112,7 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
|
||||
}
|
||||
spin_unlock(&dest->dst_lock);
|
||||
} else {
|
||||
struct flowi fl = {
|
||||
.fl4_dst = daddr,
|
||||
.fl4_tos = rtos,
|
||||
};
|
||||
|
||||
rt = ip_route_output_key(net, &fl);
|
||||
rt = ip_route_output(net, daddr, 0, rtos, 0);
|
||||
if (IS_ERR(rt)) {
|
||||
IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
|
||||
&daddr);
|
||||
|
Reference in New Issue
Block a user