};
struct metadata_dst;
+/* A fan overlay /8 (250.0.0.0/8, for example) maps to exactly one /16
+ * underlay (10.88.0.0/16, for example). Multiple local addresses within
+ * the /16 may be used, but a particular overlay may not span
+ * multiple underlay subnets.
+ *
+ * We store one underlay, indexed by the overlay's high order octet.
+ */
+#define FAN_OVERLAY_CNT 256
+
+struct ip_fan_map {
+ __be32 underlay;
+ __be32 overlay;
+ u16 underlay_prefix;
+ u16 overlay_prefix;
+ u32 overlay_mask;
+ struct list_head list;
+ struct rcu_head rcu;
+};
+
+struct ip_tunnel_fan {
+ struct list_head fan_maps;
+};
struct ip_tunnel {
struct ip_tunnel __rcu *next;
#endif
struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
unsigned int prl_count; /* # of entries in PRL */
+ struct ip_tunnel_fan fan;
unsigned int ip_tnl_net_id;
struct gro_cells gro_cells;
__u32 fwmark;
#define TUNNEL_OPTIONS_PRESENT \
(TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
+static inline int fan_has_map(const struct ip_tunnel_fan *fan)
+{
+ return !list_empty(&fan->fan_maps);
+}
+
struct tnl_ptk_info {
__be16 flags;
__be16 proto;