diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/net/route.h b/include/net/route.h index 5cd46d1c0e14..93e10c453f6b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -114,7 +114,7 @@ extern int ip_rt_init(void); | |||
114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
115 | __be32 src, struct net_device *dev); | 115 | __be32 src, struct net_device *dev); |
116 | extern void rt_cache_flush(struct net *net, int how); | 116 | extern void rt_cache_flush(struct net *net, int how); |
117 | extern void rt_cache_flush_batch(void); | 117 | extern void rt_cache_flush_batch(struct net *net); |
118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
@@ -169,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
169 | { | 169 | { |
170 | struct flowi fl = { .oif = oif, | 170 | struct flowi fl = { .oif = oif, |
171 | .mark = sk->sk_mark, | 171 | .mark = sk->sk_mark, |
172 | .nl_u = { .ip4_u = { .daddr = dst, | 172 | .fl4_dst = dst, |
173 | .saddr = src, | 173 | .fl4_src = src, |
174 | .tos = tos } }, | 174 | .fl4_tos = tos, |
175 | .proto = protocol, | 175 | .proto = protocol, |
176 | .uli_u = { .ports = | 176 | .fl_ip_sport = sport, |
177 | { .sport = sport, | 177 | .fl_ip_dport = dport }; |
178 | .dport = dport } } }; | ||
179 | |||
180 | int err; | 178 | int err; |
181 | struct net *net = sock_net(sk); | 179 | struct net *net = sock_net(sk); |
182 | 180 | ||
@@ -233,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
233 | return skb_rtable(skb)->rt_iif; | 231 | return skb_rtable(skb)->rt_iif; |
234 | } | 232 | } |
235 | 233 | ||
234 | extern int sysctl_ip_default_ttl; | ||
235 | |||
236 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | ||
237 | { | ||
238 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
239 | |||
240 | if (hoplimit == 0) | ||
241 | hoplimit = sysctl_ip_default_ttl; | ||
242 | return hoplimit; | ||
243 | } | ||
244 | |||
236 | #endif /* _ROUTE_H */ | 245 | #endif /* _ROUTE_H */ |