Skip to contentSkip to conversation

netns_netlink: Check ip tuntap support

PATCH New Petr Vorel 2 participants 3 messages May 12, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 netns_netlink: Check ip tuntap support

11b1fea9d removed ip version check. Although check shouldn't be needed because version 100519 (v2.6.34) is old enough, add check.

Instead of parsing ip version just try run 'ip tuntap'.

Fixes ("netns_netlink: Rewrite into new API")

---
Hi Cyril,

feel free to reject this as most of the distros having that old kernel will also have too old toolchain to compile recent LTP (tst_netdevice.c:218:44: error: use of undeclared identifier 'IFA_FLAGS').

Kind regards,
Petr

 testcases/kernel/containers/netns/netns_netlink.c | 9 +++++++++
 1 file changed, 9 insertions(+)
testcases/kernel/containers/netns/netns_netlink.c +9 -0
index 1e8e78fc5..ab56afb99 100644
@@ -36,11 +36,19 @@
 #include <sched.h>
 
 #include "tst_test.h"
+#include "tst_cmd.h"
 #include "tst_safe_macros.h"
 #include "lapi/namespaces_constants.h"
 
 #define MAX_TRIES 1000
 
+static void setup(void)
+{
+	if (tst_cmd((const char *const []){"ip", "tuntap", NULL}, "/dev/null",
+		      NULL, TST_CMD_PASS_RETVAL | TST_CMD_TCONF_ON_MISSING))
+		tst_brk(TCONF, "ip missing tuntap support");
+}
+
 static void child_func(void)
 {
 	int fd, len, event_found, tries;
@@ -114,6 +122,7 @@ static void test_netns_netlink(void)
 
 
 static struct tst_test test = {
+	.setup = setup,
 	.test_all = test_netns_netlink,
 	.needs_checkpoints = 1,
 	.needs_tmpdir = 1,
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 netns_netlink: Check ip tuntap support

Hi!

Quoted 4 lines

11b1fea9d removed ip version check. Although check shouldn't be needed because version 100519 (v2.6.34) is old enough, add check.

Instead of parsing ip version just try run 'ip tuntap'.

What is the exact problem here? Missing tuntap support in ip before v2.6.34?

The v2.6.34 was released in 2010 and v2.6.32 in 2009, so unless someone reports breakage during pre-release testing I wouldn't bother.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 netns_netlink: Check ip tuntap support

Hi Cyril,

Quoted 8 lines

Hi!

Quoted 4 lines

11b1fea9d removed ip version check. Although check shouldn't be needed because version 100519 (v2.6.34) is old enough, add check.

Instead of parsing ip version just try run 'ip tuntap'.

What is the exact problem here? Missing tuntap support in ip before v2.6.34?

Yes.

Quoted 2 lines

The v2.6.34 was released in 2010 and v2.6.32 in 2009, so unless someone reports breakage during pre-release testing I wouldn't bother.

Sure, let's keep it as a backup if anybody complains. I suppose nobody bothers.

Kind regards,
Petr