Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: allow setting the default network locking backend #2583

Open
wants to merge 7 commits into
base: criu-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ ifneq ($(GCOV),)
CFLAGS += $(CFLAGS-GCOV)
endif

ifneq ($(NETWORK_LOCK_DEFAULT),)
CFLAGS += -DNETWORK_LOCK_DEFAULT=$(NETWORK_LOCK_DEFAULT)
endif

ifeq ($(ASAN),1)
CFLAGS-ASAN := -fsanitize=address
export CFLAGS-ASAN
Expand Down
8 changes: 8 additions & 0 deletions criu/include/cr_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ enum NETWORK_LOCK_METHOD {
NETWORK_LOCK_SKIP,
};

/**
* CRIU currently defaults to the iptables locking backend.
*
* It is, however, possible to change this by defining
* NETWORK_LOCK_DEFAULT to a different value on the command-line.
*/
#ifndef NETWORK_LOCK_DEFAULT
#define NETWORK_LOCK_DEFAULT NETWORK_LOCK_IPTABLES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we change the default to nftable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. Currently Fedora >= 42 defaults to nft and CentOS Stream >= 10 (RHEL >= 10).

@danishprakash mentioned that Suse is also looking into switching to nft. Not sure what other distributions are planing.

Maintaining the RHEL and Fedora packages it would make my life a bit easier, but I still need to deal with older Fedora and RHEL releases. It feels a bit too early. Maybe if Debian or Ubuntu also switches to nft, the we would have most of the bigger distributions.

#endif

/*
* Ghost file size we allow to carry by default.
Expand Down