diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/ip_tunnels.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 5f28b606633e..e1395d70fb48 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
| @@ -140,6 +140,7 @@ struct ip_tunnel { | |||
| 140 | #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) | 140 | #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400) |
| 141 | #define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800) | 141 | #define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800) |
| 142 | #define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000) | 142 | #define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000) |
| 143 | #define TUNNEL_NOCACHE __cpu_to_be16(0x2000) | ||
| 143 | 144 | ||
| 144 | #define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT) | 145 | #define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT) |
| 145 | 146 | ||
| @@ -206,6 +207,20 @@ static inline void ip_tunnel_key_init(struct ip_tunnel_key *key, | |||
| 206 | 0, sizeof(*key) - IP_TUNNEL_KEY_SIZE); | 207 | 0, sizeof(*key) - IP_TUNNEL_KEY_SIZE); |
| 207 | } | 208 | } |
| 208 | 209 | ||
| 210 | static inline bool | ||
| 211 | ip_tunnel_dst_cache_usable(const struct sk_buff *skb, | ||
| 212 | const struct ip_tunnel_info *info) | ||
| 213 | { | ||
| 214 | if (skb->mark) | ||
| 215 | return false; | ||
| 216 | if (!info) | ||
| 217 | return true; | ||
| 218 | if (info->key.tun_flags & TUNNEL_NOCACHE) | ||
| 219 | return false; | ||
| 220 | |||
| 221 | return true; | ||
| 222 | } | ||
| 223 | |||
| 209 | static inline unsigned short ip_tunnel_info_af(const struct ip_tunnel_info | 224 | static inline unsigned short ip_tunnel_info_af(const struct ip_tunnel_info |
| 210 | *tun_info) | 225 | *tun_info) |
| 211 | { | 226 | { |
