It is common to run make check as an unprivileged user.
And in that case calling dpif_netlink_rtnl_create() to add a tunnel
fails due to insufficient privileges. Which is assumed
to mean that OOT Kernel tunnels are used.

Reverse this assumption and assume they are not being used.
An assumption in making this change is that the distinction
is unimportant in terms of run-time tunnel usage as as
make check doesn't use kernel tunnels.

However, a follow-up patch will add a deprecation notice, which prints
in the case that OOT Kernel tunnels are used.  It does not seem useful
to print in the case of make check.  And doing so breaks existing tests
run by that target.

Signed-off-by: Simon Horman <[email protected]>
--
v2: New patch

This patch works on the principle that small, subtle changes,
are accompanied by explanations and comments significantly larger
than the code change.
---
 lib/dpif-netlink-rtnl.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
index 
08054aa28096f81ac069d261051652260de51423..2a76d6504f732de50047c158ff67d00b7b29fffc
 100644
--- a/lib/dpif-netlink-rtnl.c
+++ b/lib/dpif-netlink-rtnl.c
@@ -605,7 +605,15 @@ dpif_netlink_rtnl_probe_oot_tunnels(void)
                                          "ovs_geneve",
                                          (NLM_F_REQUEST | NLM_F_ACK
                                           | NLM_F_CREATE));
-        if (error != EOPNOTSUPP) {
+        /* EOPNOTSUPP indicates that OOT tunnel support is not present
+         * EPERM indicates insufficient permissions to add a tunnel.
+         * This may occur when OVS is run by an unprivileged user,
+         * e.g. when running make check.
+         * As this case doesn't use kernel tunnels, assume that they
+         * are not present for the sake of logic that warns if they are
+         * used.
+         */
+        if (error != EOPNOTSUPP && error != EPERM) {
             if (!error) {
                 dpif_netlink_rtnl_destroy(name);
             }

-- 
2.47.3

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to