Skip to content

Commit

Permalink
route-exchange-netlink: Use existing RTPROT_OVN.
Browse files Browse the repository at this point in the history
The RTPROT_OVN value has been merged to the net-next tree [1].
Until it is available on all systems ovs forward declares this value.

This allows us to drop the definition of the value from OVN.

[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>
  • Loading branch information
felixhuettner committed Feb 27, 2025
1 parent 83b4802 commit 2f2ab56
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "ovs"]
path = ovs
url = https://github.com/openvswitch/ovs.git
url = https://github.com/felixhuettner/ovs.git
10 changes: 5 additions & 5 deletions controller/route-exchange-netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#include "openvswitch/list.h"
#include <netinet/in.h>
#include <net/if.h>
#include <linux/rtnetlink.h>

/* This value is arbitrary but currently unused.
* See the kernel rtnetlink UAPI at
* https://github.com/torvalds/linux/blob/master/include/uapi/linux/rtnetlink.h
* */
#define RTPROT_OVN 84
/* RTPROT_OVN is defined in the kernel rtnetlink.h and forward declared in the
* OVS submodule. While the value should always be 84 we validate this here as
* tests will fail if that value ever changes. */
BUILD_ASSERT_DECL(RTPROT_OVN == 84);

struct in6_addr;
struct hmap;
Expand Down
6 changes: 6 additions & 0 deletions m4/ovn.m4
Original file line number Diff line number Diff line change
Expand Up @@ -584,4 +584,10 @@ 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.])])
])

0 comments on commit 2f2ab56

Please sign in to comment.