diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 00:00:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:42 -0500 |
commit | 78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch) | |
tree | 9dccc5c16bf269d53d8499064ec95a998e84c646 /drivers/net/bonding/bond_main.c | |
parent | 1561747ddf9d28185548687b11aae7074d6129c4 (diff) |
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/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 68a5ce0a649f..3ad4f501949e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2676,7 +2676,6 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2676 | __be32 *targets = bond->params.arp_targets; | 2676 | __be32 *targets = bond->params.arp_targets; |
2677 | struct vlan_entry *vlan; | 2677 | struct vlan_entry *vlan; |
2678 | struct net_device *vlan_dev; | 2678 | struct net_device *vlan_dev; |
2679 | struct flowi fl; | ||
2680 | struct rtable *rt; | 2679 | struct rtable *rt; |
2681 | 2680 | ||
2682 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 2681 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { |
@@ -2695,15 +2694,12 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2695 | * determine which VLAN interface would be used, so we | 2694 | * determine which VLAN interface would be used, so we |
2696 | * can tag the ARP with the proper VLAN tag. | 2695 | * can tag the ARP with the proper VLAN tag. |
2697 | */ | 2696 | */ |
2698 | memset(&fl, 0, sizeof(fl)); | 2697 | rt = ip_route_output(dev_net(bond->dev), targets[i], 0, |
2699 | fl.fl4_dst = targets[i]; | 2698 | RTO_ONLINK, 0); |
2700 | fl.fl4_tos = RTO_ONLINK; | ||
2701 | |||
2702 | rt = ip_route_output_key(dev_net(bond->dev), &fl); | ||
2703 | if (IS_ERR(rt)) { | 2699 | if (IS_ERR(rt)) { |
2704 | if (net_ratelimit()) { | 2700 | if (net_ratelimit()) { |
2705 | pr_warning("%s: no route to arp_ip_target %pI4\n", | 2701 | pr_warning("%s: no route to arp_ip_target %pI4\n", |
2706 | bond->dev->name, &fl.fl4_dst); | 2702 | bond->dev->name, &targets[i]); |
2707 | } | 2703 | } |
2708 | continue; | 2704 | continue; |
2709 | } | 2705 | } |
@@ -2739,7 +2735,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2739 | 2735 | ||
2740 | if (net_ratelimit()) { | 2736 | if (net_ratelimit()) { |
2741 | pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", | 2737 | pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n", |
2742 | bond->dev->name, &fl.fl4_dst, | 2738 | bond->dev->name, &targets[i], |
2743 | rt->dst.dev ? rt->dst.dev->name : "NULL"); | 2739 | rt->dst.dev ? rt->dst.dev->name : "NULL"); |
2744 | } | 2740 | } |
2745 | ip_rt_put(rt); | 2741 | ip_rt_put(rt); |