diff options
author | Thomas Graf <tgraf@suug.ch> | 2015-07-21 04:44:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-21 13:39:06 -0400 |
commit | e7030878fc8448492b6e5cecd574043f63271298 (patch) | |
tree | 93a7e8a5ab3b5a0633c71d2684186114ab40b7e2 /include/net/ip_tunnels.h | |
parent | 3093fbe7ff4bc7d1571fc217dade1cf80330a714 (diff) |
fib: Add fib rule match on tunnel id
This add the ability to select a routing table based on the tunnel
id which allows to maintain separate routing tables for each virtual
tunnel network.
ip rule add from all tunnel-id 100 lookup 100
ip rule add from all tunnel-id 200 lookup 200
A new static key controls the collection of metadata at tunnel level
upon demand.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_tunnels.h')
-rw-r--r-- | include/net/ip_tunnels.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 0b7e18cfa0b4..0a5a7763eec2 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
@@ -303,6 +303,17 @@ static inline struct ip_tunnel_info *lwt_tun_info(struct lwtunnel_state *lwtstat | |||
303 | return (struct ip_tunnel_info *)lwtstate->data; | 303 | return (struct ip_tunnel_info *)lwtstate->data; |
304 | } | 304 | } |
305 | 305 | ||
306 | extern struct static_key ip_tunnel_metadata_cnt; | ||
307 | |||
308 | /* Returns > 0 if metadata should be collected */ | ||
309 | static inline int ip_tunnel_collect_metadata(void) | ||
310 | { | ||
311 | return static_key_false(&ip_tunnel_metadata_cnt); | ||
312 | } | ||
313 | |||
314 | void ip_tunnel_need_metadata(void); | ||
315 | void ip_tunnel_unneed_metadata(void); | ||
316 | |||
306 | #endif /* CONFIG_INET */ | 317 | #endif /* CONFIG_INET */ |
307 | 318 | ||
308 | #endif /* __NET_IP_TUNNELS_H */ | 319 | #endif /* __NET_IP_TUNNELS_H */ |