diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/route.h b/include/net/route.h index b8c1f7703fc6..27002362944a 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -231,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
231 | return skb_rtable(skb)->rt_iif; | 231 | return skb_rtable(skb)->rt_iif; |
232 | } | 232 | } |
233 | 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 | |||
234 | #endif /* _ROUTE_H */ | 245 | #endif /* _ROUTE_H */ |