]> git.proxmox.com Git - ovs.git/blobdiff - datapath/linux/compat/geneve.c
compat: Fixups for newer kernels
[ovs.git] / datapath / linux / compat / geneve.c
index 0fcc6e51d7083d58cb4fe64a46e6efcb5eca3672..435a23fb7c8cd5106dd16b478ce2339eddf1e05c 100644 (file)
@@ -1336,7 +1336,11 @@ static void geneve_setup(struct net_device *dev)
 
        dev->netdev_ops = &geneve_netdev_ops;
        dev->ethtool_ops = &geneve_ethtool_ops;
+#ifndef HAVE_NEEDS_FREE_NETDEV
        dev->destructor = free_netdev;
+#else
+       dev->needs_free_netdev = true;
+#endif
 
        SET_NETDEV_DEVTYPE(dev, &geneve_type);
 
@@ -1370,7 +1374,12 @@ static const struct nla_policy geneve_policy[IFLA_GENEVE_MAX + 1] = {
        [IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = { .type = NLA_U8 },
 };
 
+#ifdef  HAVE_EXT_ACK_IN_RTNL_LINKOPS
+static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
+                          struct netlink_ext_ack *extack)
+#else
 static int geneve_validate(struct nlattr *tb[], struct nlattr *data[])
+#endif
 {
        if (tb[IFLA_ADDRESS]) {
                if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -1489,8 +1498,14 @@ static int geneve_configure(struct net *net, struct net_device *dev,
        return 0;
 }
 
+#ifdef  HAVE_EXT_ACK_IN_RTNL_LINKOPS
+static int geneve_newlink(struct net *net, struct net_device *dev,
+                         struct nlattr *tb[], struct nlattr *data[],
+                         struct netlink_ext_ack *extack)
+#else
 static int geneve_newlink(struct net *net, struct net_device *dev,
                          struct nlattr *tb[], struct nlattr *data[])
+#endif
 {
        __be16 dst_port = htons(GENEVE_UDP_PORT);
        __u8 ttl = 0, tos = 0;