diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-04 15:33:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-04 15:55:07 -0400 |
commit | cbb1e85f9cfd2bd9b7edfd21d167e89a4279faf0 (patch) | |
tree | 352ce07ff62b9fc38212d72f3d1b0d124dafea39 /include/net/route.h | |
parent | 9a1b9496cd2b013f74885218947fa7120d53e74c (diff) |
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.h | 19 |
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 | |||
152 | return ip_route_output_flow(net, fl4, sk); | 152 | return ip_route_output_flow(net, fl4, sk); |
153 | } | 153 | } |
154 | 154 | ||
155 | static inline struct rtable *ip_route_output_gre(struct net *net, | 155 | static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 *fl4, |
156 | __be32 daddr, __be32 saddr, | 156 | __be32 daddr, __be32 saddr, |
157 | __be32 gre_key, __u8 tos, int oif) | 157 | __be32 gre_key, __u8 tos, int oif) |
158 | { | 158 | { |
159 | struct flowi4 fl4 = { | 159 | memset(fl4, 0, sizeof(*fl4)); |
160 | .flowi4_oif = oif, | 160 | fl4->flowi4_oif = oif; |
161 | .daddr = daddr, | 161 | fl4->daddr = daddr; |
162 | .saddr = saddr, | 162 | fl4->saddr = saddr; |
163 | .flowi4_tos = tos, | 163 | fl4->flowi4_tos = tos; |
164 | .flowi4_proto = IPPROTO_GRE, | 164 | fl4->flowi4_proto = IPPROTO_GRE; |
165 | .fl4_gre_key = gre_key, | 165 | fl4->fl4_gre_key = gre_key; |
166 | }; | 166 | return ip_route_output_key(net, fl4); |
167 | return ip_route_output_key(net, &fl4); | ||
168 | } | 167 | } |
169 | 168 | ||
170 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, | 169 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, |