Skip to content

Commit

Permalink
sig_int
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang committed Apr 1, 2024
1 parent a3fde05 commit 09423a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09423a3

Please sign in to comment.