aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorJon Maloy <jmaloy@redhat.com>2024-12-10 13:36:45 -0500
committerStefano Brivio <sbrivio@redhat.com>2024-12-11 01:47:37 +0100
commite24f0262229a1f9c673dca3452ad103cbe06b866 (patch)
tree8a29785cfd4d58114c4679afe364eba638a4e298 /conf.c
parent947f5cdb93062fd4e56adbab9901bbbb8aa8b5cb (diff)
downloadpasst-e24f0262229a1f9c673dca3452ad103cbe06b866.tar
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.tar.gz
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.tar.bz2
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.tar.lz
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.tar.xz
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.tar.zst
passt-e24f0262229a1f9c673dca3452ad103cbe06b866.zip
pasta: make it possible to disable socket splicing
During testing it is sometimes useful to force traffic which would normally be forwared by socket splicing through the tap interface. In this commit, we add a command switch enabling such funtionality for inbound local traffic. For outbound local traffic this is much trickier, if even possible, so leave that for a later commit. Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Jon Maloy <jmaloy@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/conf.c b/conf.c
index eaa7d99..97d8beb 100644
--- a/conf.c
+++ b/conf.c
@@ -977,7 +977,8 @@ pasta_opts:
" Don't copy all routes to namespace\n"
" --no-copy-addrs DEPRECATED:\n"
" Don't copy all addresses to namespace\n"
- " --ns-mac-addr ADDR Set MAC address on tap interface\n");
+ " --ns-mac-addr ADDR Set MAC address on tap interface\n"
+ " --no-splice Disable inbound socket splicing\n");
exit(status);
}
@@ -1319,6 +1320,7 @@ void conf(struct ctx *c, int argc, char **argv)
{"no-dhcpv6", no_argument, &c->no_dhcpv6, 1 },
{"no-ndp", no_argument, &c->no_ndp, 1 },
{"no-ra", no_argument, &c->no_ra, 1 },
+ {"no-splice", no_argument, &c->no_splice, 1 },
{"freebind", no_argument, &c->freebind, 1 },
{"no-map-gw", no_argument, &no_map_gw, 1 },
{"ipv4-only", no_argument, NULL, '4' },
@@ -1756,6 +1758,9 @@ void conf(struct ctx *c, int argc, char **argv)
}
} while (name != -1);
+ if (c->mode != MODE_PASTA)
+ c->no_splice = 1;
+
if (c->mode == MODE_PASTA && !c->pasta_conf_ns) {
if (copy_routes_opt)
die("--no-copy-routes needs --config-net");