From 09423a3e3e6a4a0c8715ade25602b0511fe7fa98 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Mon, 1 Apr 2024 10:58:18 +0800 Subject: [PATCH] sig_int Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index b4fa9f28159d..12f9dd7acba6 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -76,11 +76,17 @@ struct mptcp_storage { char ca_name[TCP_CA_NAME_MAX]; }; +static void sig_int(int sig) { + signal(sig, SIG_IGN); + SYS_NOFAIL("ip netns del %s", NS_TEST); +} + static struct nstoken *create_netns(void) { SYS(fail, "ip netns add %s", NS_TEST); SYS(fail, "ip -net %s link set dev lo up", NS_TEST); + signal(SIGINT, sig_int); return open_netns(NS_TEST); fail: return NULL;