RTPROT_OVN has been merged to the net-next tree of the kernel just now [1].
Until it is available on all systems we need to forward declare it.

As we are already on it we also add support for it in
test-lib-route-table.

[1]: 
https://web.git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=6002850fdfe0b4343136670a9895b6ba4ee3285b

Signed-off-by: Felix Huettner <felix.huettner@stackit.cloud>
---
 acinclude.m4                 |  6 ++++++
 include/linux/automake.mk    |  1 +
 include/linux/rtnetlink.h    | 12 ++++++++++++
 tests/test-lib-route-table.c |  1 +
 4 files changed, 20 insertions(+)
 create mode 100644 include/linux/rtnetlink.h

diff --git a/acinclude.m4 b/acinclude.m4
index 8658bcfcb..278bad583 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -155,6 +155,12 @@ AC_DEFUN([OVS_CHECK_LINUX_NETLINK], [
     ])],
     [AC_DEFINE([HAVE_NLA_BITFIELD32], [1],
     [Define to 1 if struct nla_bitfield32 is available.])])
+  AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([#include <linux/rtnetlink.h>], [
+        int x = RTPROT_OVN;
+    ])],
+    [AC_DEFINE([HAVE_RTPROT_OVN], [1],
+               [Define to 1 if RTPROT_OVN is available.])])
 ])
 
 dnl OVS_CHECK_LINUX_TC
diff --git a/include/linux/automake.mk b/include/linux/automake.mk
index ac306b53c..4a92d45ef 100644
--- a/include/linux/automake.mk
+++ b/include/linux/automake.mk
@@ -3,6 +3,7 @@ noinst_HEADERS += \
        include/linux/netfilter/nf_conntrack_sctp.h \
        include/linux/openvswitch.h \
        include/linux/pkt_cls.h \
+       include/linux/rtnetlink.h \
        include/linux/psample.h \
        include/linux/gen_stats.h \
        include/linux/tc_act/tc_mpls.h \
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
new file mode 100644
index 000000000..deac39677
--- /dev/null
+++ b/include/linux/rtnetlink.h
@@ -0,0 +1,12 @@
+#ifndef __UAPI_LINUX_RTNETLINK_WRAPPER_H
+#define __UAPI_LINUX_RTNETLINK_WRAPPER_H 1
+
+#if !defined(__KERNEL__) && !defined(HAVE_RTPROT_OVN)
+
+#define RTPROT_OVN 84
+
+#endif /* !__KERNEL__ && !HAVE_RTPROT_OVN */
+
+#include_next <linux/rtnetlink.h>
+
+#endif /* __UAPI_LINUX_RTNETLINK_WRAPPER_H */
diff --git a/tests/test-lib-route-table.c b/tests/test-lib-route-table.c
index 61d97e06f..40009242c 100644
--- a/tests/test-lib-route-table.c
+++ b/tests/test-lib-route-table.c
@@ -39,6 +39,7 @@ rt_prot_name(unsigned char p)
            p == RTPROT_STATIC     ? "RTPROT_STATIC"     :
            p == RTPROT_RA         ? "RTPROT_RA"         :
            p == RTPROT_DHCP       ? "RTPROT_DHCP"       :
+           p == RTPROT_OVN        ? "RTPROT_OVN"        :
            p == RTPROT_BGP        ? "RTPROT_BGP"        :
            "UNKNOWN";
 }

base-commit: 410e0f519f525a73cd471512f6b498d8f0ec36cb
-- 
2.48.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to