diff options
Diffstat (limited to 'include/net/route.h')
| -rw-r--r-- | include/net/route.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/include/net/route.h b/include/net/route.h index bce6dd68d27b..7e5e73bfa4de 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -50,9 +50,7 @@ | |||
| 50 | struct fib_nh; | 50 | struct fib_nh; |
| 51 | struct inet_peer; | 51 | struct inet_peer; |
| 52 | struct rtable { | 52 | struct rtable { |
| 53 | union { | 53 | struct dst_entry dst; |
| 54 | struct dst_entry dst; | ||
| 55 | } u; | ||
| 56 | 54 | ||
| 57 | /* Cache lookup keys */ | 55 | /* Cache lookup keys */ |
| 58 | struct flowi fl; | 56 | struct flowi fl; |
| @@ -101,7 +99,7 @@ struct rt_cache_stat { | |||
| 101 | unsigned int out_hlist_search; | 99 | unsigned int out_hlist_search; |
| 102 | }; | 100 | }; |
| 103 | 101 | ||
| 104 | extern struct ip_rt_acct *ip_rt_acct; | 102 | extern struct ip_rt_acct __percpu *ip_rt_acct; |
| 105 | 103 | ||
| 106 | struct in_device; | 104 | struct in_device; |
| 107 | extern int ip_rt_init(void); | 105 | extern int ip_rt_init(void); |
| @@ -112,7 +110,22 @@ extern void rt_cache_flush_batch(void); | |||
| 112 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 110 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
| 113 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 111 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
| 114 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 112 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
| 115 | extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); | 113 | |
| 114 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 115 | u8 tos, struct net_device *devin, bool noref); | ||
| 116 | |||
| 117 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 118 | u8 tos, struct net_device *devin) | ||
| 119 | { | ||
| 120 | return ip_route_input_common(skb, dst, src, tos, devin, false); | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 124 | u8 tos, struct net_device *devin) | ||
| 125 | { | ||
| 126 | return ip_route_input_common(skb, dst, src, tos, devin, true); | ||
| 127 | } | ||
| 128 | |||
| 116 | extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); | 129 | extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); |
| 117 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 130 | extern void ip_rt_send_redirect(struct sk_buff *skb); |
| 118 | 131 | ||
| @@ -129,7 +142,7 @@ extern void fib_add_ifaddr(struct in_ifaddr *); | |||
| 129 | static inline void ip_rt_put(struct rtable * rt) | 142 | static inline void ip_rt_put(struct rtable * rt) |
| 130 | { | 143 | { |
| 131 | if (rt) | 144 | if (rt) |
| 132 | dst_release(&rt->u.dst); | 145 | dst_release(&rt->dst); |
| 133 | } | 146 | } |
| 134 | 147 | ||
| 135 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) | 148 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) |
| @@ -186,6 +199,8 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol, | |||
| 186 | fl.fl_ip_sport = sport; | 199 | fl.fl_ip_sport = sport; |
| 187 | fl.fl_ip_dport = dport; | 200 | fl.fl_ip_dport = dport; |
| 188 | fl.proto = protocol; | 201 | fl.proto = protocol; |
| 202 | if (inet_sk(sk)->transparent) | ||
| 203 | fl.flags |= FLOWI_FLAG_ANYSRC; | ||
| 189 | ip_rt_put(*rp); | 204 | ip_rt_put(*rp); |
| 190 | *rp = NULL; | 205 | *rp = NULL; |
| 191 | security_sk_classify_flow(sk, &fl); | 206 | security_sk_classify_flow(sk, &fl); |
