A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/multipath-tcp/mptcp_net-next/commit/02d6a057c7bee44902c843949de6bbd439e33092 below:

run mptcp in a dedicated netns · multipath-tcp/mptcp_net-next@02d6a05 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+17

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+17

-2

lines changed Original file line number Diff line number Diff line change

@@ -7,6 +7,8 @@

7 7

#include "network_helpers.h"

8 8

#include "mptcp_sock.skel.h"

9 9 10 +

#define NS_TEST "mptcp_ns"

11 + 10 12

#ifndef TCP_CA_NAME_MAX

11 13

#define TCP_CA_NAME_MAX 16

12 14

#endif

@@ -138,12 +140,20 @@ static int run_test(int cgroup_fd, int server_fd, bool is_mptcp)

138 140 139 141

static void test_base(void)

140 142

{

143 +

struct nstoken *nstoken = NULL;

141 144

int server_fd, cgroup_fd;

142 145 143 146

cgroup_fd = test__join_cgroup("/mptcp");

144 147

if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup"))

145 148

return;

146 149 150 +

SYS(fail, "ip netns add %s", NS_TEST);

151 +

SYS(fail, "ip -net %s link set dev lo up", NS_TEST);

152 + 153 +

nstoken = open_netns(NS_TEST);

154 +

if (!ASSERT_OK_PTR(nstoken, "open_netns"))

155 +

goto fail;

156 + 147 157

/* without MPTCP */

148 158

server_fd = start_server(AF_INET, SOCK_STREAM, NULL, 0, 0);

149 159

if (!ASSERT_GE(server_fd, 0, "start_server"))

@@ -157,13 +167,18 @@ static void test_base(void)

157 167

/* with MPTCP */

158 168

server_fd = start_mptcp_server(AF_INET, NULL, 0, 0);

159 169

if (!ASSERT_GE(server_fd, 0, "start_mptcp_server"))

160 -

goto close_cgroup_fd;

170 +

goto fail;

161 171 162 172

ASSERT_OK(run_test(cgroup_fd, server_fd, true), "run_test mptcp");

163 173 164 174

close(server_fd);

165 175 166 -

close_cgroup_fd:

176 +

fail:

177 +

if (nstoken)

178 +

close_netns(nstoken);

179 + 180 +

SYS_NOFAIL("ip netns del " NS_TEST " &> /dev/null");

181 + 167 182

close(cgroup_fd);

168 183

}

169 184

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4