@@ -608,7 +608,12 @@ static const struct nla_policy lisp_policy[IFLA_LISP_MAX + 1] = {
[IFLA_LISP_PORT] = { .type = NLA_U16 },
};
+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS
+static int lisp_validate(struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack __always_unused *extack)
+#else
static int lisp_validate(struct nlattr *tb[], struct nlattr *data[])
+#endif
{
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -660,17 +665,15 @@ static int lisp_configure(struct net *net, struct net_device *dev,
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS
static int lisp_newlink(struct net *net, struct net_device *dev,
- struct nlattr *tb[], struct nlattr *data[])
-{
+ struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack __always_unused *extack)
#else
-static int lisp_newlink(struct net_device *dev,
+static int lisp_newlink(struct net *net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
-
-{
- struct net *net = &init_net;
#endif
+{
__be16 dst_port = htons(LISP_UDP_PORT);
if (data[IFLA_LISP_PORT])
@@ -679,11 +682,7 @@ static int lisp_newlink(struct net_device *dev,
return lisp_configure(net, dev, dst_port);
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
static void lisp_dellink(struct net_device *dev, struct list_head *head)
-#else
-static void lisp_dellink(struct net_device *dev)
-#endif
{
struct lisp_dev *lisp = netdev_priv(dev);
@@ -1909,7 +1909,12 @@ static const struct nla_policy stt_policy[IFLA_STT_MAX + 1] = {
[IFLA_STT_PORT] = { .type = NLA_U16 },
};
+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS
+static int stt_validate(struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack __always_unused *extack)
+#else
static int stt_validate(struct nlattr *tb[], struct nlattr *data[])
+#endif
{
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
@@ -1961,8 +1966,14 @@ static int stt_configure(struct net *net, struct net_device *dev,
return 0;
}
+#ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS
+static int stt_newlink(struct net *net, struct net_device *dev,
+ struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack __always_unused *extack)
+#else
static int stt_newlink(struct net *net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
+#endif
{
__be16 dst_port = htons(STT_DST_PORT);
The RTNL ops validate and newlink functions now take the extended netlink ack parameter. Use the new HAVE_EXT_ACK_IN_RTNL_LINKOPS define to check if the additional parameter is present and add the parameter if so. While in the modules remove the checks for Linux kernels < 2.3.39 since they are no longer supported since 2.5.x. Signed-off-by: Greg Rose <gvrose8192@gmail.com> --- datapath/linux/compat/lisp.c | 21 ++++++++++----------- datapath/linux/compat/stt.c | 11 +++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-)