aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 00:00:52 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:42 -0500
commit78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch)
tree9dccc5c16bf269d53d8499064ec95a998e84c646 /net/ipv4/ipmr.c
parent1561747ddf9d28185548687b11aae7074d6129c4 (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 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 74909bac8817..594a3004367b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1611,25 +1611,19 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
1611#endif 1611#endif
1612 1612
1613 if (vif->flags & VIFF_TUNNEL) { 1613 if (vif->flags & VIFF_TUNNEL) {
1614 struct flowi fl = { 1614 rt = ip_route_output_ports(net, NULL,
1615 .oif = vif->link, 1615 vif->remote, vif->local,
1616 .fl4_dst = vif->remote, 1616 0, 0,
1617 .fl4_src = vif->local, 1617 IPPROTO_IPIP,
1618 .fl4_tos = RT_TOS(iph->tos), 1618 RT_TOS(iph->tos), vif->link);
1619 .proto = IPPROTO_IPIP
1620 };
1621 rt = ip_route_output_key(net, &fl);
1622 if (IS_ERR(rt)) 1619 if (IS_ERR(rt))
1623 goto out_free; 1620 goto out_free;
1624 encap = sizeof(struct iphdr); 1621 encap = sizeof(struct iphdr);
1625 } else { 1622 } else {
1626 struct flowi fl = { 1623 rt = ip_route_output_ports(net, NULL, iph->daddr, 0,
1627 .oif = vif->link, 1624 0, 0,
1628 .fl4_dst = iph->daddr, 1625 IPPROTO_IPIP,
1629 .fl4_tos = RT_TOS(iph->tos), 1626 RT_TOS(iph->tos), vif->link);
1630 .proto = IPPROTO_IPIP
1631 };
1632 rt = ip_route_output_key(net, &fl);
1633 if (IS_ERR(rt)) 1627 if (IS_ERR(rt))
1634 goto out_free; 1628 goto out_free;
1635 } 1629 }