aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h27
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 @@
50struct fib_nh; 50struct fib_nh;
51struct inet_peer; 51struct inet_peer;
52struct rtable { 52struct 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
104extern struct ip_rt_acct *ip_rt_acct; 102extern struct ip_rt_acct __percpu *ip_rt_acct;
105 103
106struct in_device; 104struct in_device;
107extern int ip_rt_init(void); 105extern int ip_rt_init(void);
@@ -112,7 +110,22 @@ extern void rt_cache_flush_batch(void);
112extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 110extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
113extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); 111extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
114extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 112extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
115extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); 113
114extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src,
115 u8 tos, struct net_device *devin, bool noref);
116
117static 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
123static 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
116extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); 129extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
117extern void ip_rt_send_redirect(struct sk_buff *skb); 130extern void ip_rt_send_redirect(struct sk_buff *skb);
118 131
@@ -129,7 +142,7 @@ extern void fib_add_ifaddr(struct in_ifaddr *);
129static inline void ip_rt_put(struct rtable * rt) 142static 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);