datapath: define compat ip_tunnel_get_iflink()
authorPravin B Shelar <pshelar@nicira.com>
Fri, 11 Dec 2015 04:02:59 +0000 (20:02 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 11 Dec 2015 21:49:47 +0000 (13:49 -0800)
ip_tunnel_get_iflink() depends on ip_tunnel structure. But OVS
compat layer defines its own ip_tunnel structure which is not
compatible with all upstream kernel versions. Therefore we
can no use such function.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/linux/compat/include/net/ip_tunnels.h
datapath/linux/compat/ip_tunnel.c

index 47dce78..185d7e9 100644 (file)
@@ -302,5 +302,7 @@ void rpl_ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *o
 #define ip_tunnel_setup rpl_ip_tunnel_setup
 void rpl_ip_tunnel_setup(struct net_device *dev, int net_id);
 
+#define ip_tunnel_get_iflink rpl_ip_tunnel_get_iflink
+int rpl_ip_tunnel_get_iflink(const struct net_device *dev);
 #endif /* HAVE_METADATA_DST */
 #endif /* __NET_IP_TUNNELS_H */
index f43e2d4..db0cb8e 100644 (file)
@@ -282,4 +282,12 @@ void rpl_ip_tunnel_setup(struct net_device *dev, int net_id)
 
        tunnel->ip_tnl_net_id = net_id;
 }
+
+int rpl_ip_tunnel_get_iflink(const struct net_device *dev)
+{
+       struct ip_tunnel *tunnel = netdev_priv(dev);
+
+       return tunnel->parms.link;
+}
+
 #endif