Skip to content

Commit

Permalink
net: use legacy iptables for network locking
Browse files Browse the repository at this point in the history
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Jan 1, 2024
1 parent 5670b48 commit 73ceefd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions criu/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -3031,10 +3031,16 @@ int netns_keep_nsfd(void)
static int iptables_restore(bool ipv6, char *buf, int size)
{
int pfd[2], ret = -1;
char *cmd4[] = { "iptables-restore", "-w", "--noflush", NULL };
char *cmd6[] = { "ip6tables-restore", "-w", "--noflush", NULL };
char *ipt_legacy_bin = get_legacy_iptables_bin(ipv6, true);
char *cmd4[] = { ipt_legacy_bin, "-w", "--noflush", NULL };
char *cmd6[] = { ipt_legacy_bin, "-w", "--noflush", NULL };
char **cmd = ipv6 ? cmd6 : cmd4;

if (!ipt_legacy_bin) {
pr_warn("Couldn't find iptables version which is using iptables legacy API\n");
return -1;
}

if (pipe(pfd) < 0) {
pr_perror("Unable to create pipe");
return -1;
Expand Down
1 change: 1 addition & 0 deletions scripts/build/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
RUN apk add \
ip6tables \
iptables \
iptables-legacy \
nftables \
iproute2 \
tar \
Expand Down

0 comments on commit 73ceefd

Please sign in to comment.