summaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-04 12:33:34 -0700
committerDavid S. Miller <davem@davemloft.net>2011-05-04 12:55:07 -0700
commitcbb1e85f9cfd2bd9b7edfd21d167e89a4279faf0 (patch)
tree352ce07ff62b9fc38212d72f3d1b0d124dafea39 /include/net/route.h
parent9a1b9496cd2b013f74885218947fa7120d53e74c (diff)
downloadblackbird-obmc-linux-cbb1e85f9cfd2bd9b7edfd21d167e89a4279faf0.tar.gz
blackbird-obmc-linux-cbb1e85f9cfd2bd9b7edfd21d167e89a4279faf0.zip
ipv4: Kill rt->rt_{src, dst} usage in IP GRE tunnels.
First, make callers pass on-stack flowi4 to ip_route_output_gre() so they can get at the fully resolved flow key. Next, use that in ipgre_tunnel_xmit() to avoid the need to use rt->rt_{dst,src}. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 8c02c871a8ce..9f8070b251fb 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -152,19 +152,18 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi
return ip_route_output_flow(net, fl4, sk);
}
-static inline struct rtable *ip_route_output_gre(struct net *net,
+static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 *fl4,
__be32 daddr, __be32 saddr,
__be32 gre_key, __u8 tos, int oif)
{
- struct flowi4 fl4 = {
- .flowi4_oif = oif,
- .daddr = daddr,
- .saddr = saddr,
- .flowi4_tos = tos,
- .flowi4_proto = IPPROTO_GRE,
- .fl4_gre_key = gre_key,
- };
- return ip_route_output_key(net, &fl4);
+ memset(fl4, 0, sizeof(*fl4));
+ fl4->flowi4_oif = oif;
+ fl4->daddr = daddr;
+ fl4->saddr = saddr;
+ fl4->flowi4_tos = tos;
+ fl4->flowi4_proto = IPPROTO_GRE;
+ fl4->fl4_gre_key = gre_key;
+ return ip_route_output_key(net, fl4);
}
extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
OpenPOWER on IntegriCloud