diff mbox

[ovs-dev,1/3] datapath: define compat ip_tunnel_get_iflink()

Message ID 1449806581-28010-1-git-send-email-pshelar@nicira.com
State Accepted
Headers show

Commit Message

Pravin B Shelar Dec. 11, 2015, 4:02 a.m. UTC
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>
---
 datapath/linux/compat/include/net/ip_tunnels.h | 2 ++
 datapath/linux/compat/ip_tunnel.c              | 8 ++++++++
 2 files changed, 10 insertions(+)

Comments

Jesse Gross Dec. 11, 2015, 8:43 p.m. UTC | #1
On Thu, Dec 10, 2015 at 8:02 PM, Pravin B Shelar <pshelar@nicira.com> wrote:
> 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>
diff mbox

Patch

diff --git a/datapath/linux/compat/include/net/ip_tunnels.h b/datapath/linux/compat/include/net/ip_tunnels.h
index 47dce78..185d7e9 100644
--- a/datapath/linux/compat/include/net/ip_tunnels.h
+++ b/datapath/linux/compat/include/net/ip_tunnels.h
@@ -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 */
diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
index f43e2d4..db0cb8e 100644
--- a/datapath/linux/compat/ip_tunnel.c
+++ b/datapath/linux/compat/ip_tunnel.c
@@ -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