Skip to content

Commit

Permalink
MT#55283 honour userspace fallback
Browse files Browse the repository at this point in the history
... even in the case of nftables setup failure.

Change-Id: I6c5ad81354831c31a120afaecd17d8d4093bd5ea
(cherry picked from commit 1a45621)
  • Loading branch information
rfuchs committed Jun 14, 2024
1 parent db2562a commit ebf47f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,12 @@ static void kernel_setup(void) {
(nftables_args) {.table = rtpe_config.kernel_table,
.append = rtpe_config.nftables_append,
.family = rtpe_config.nftables_family});
if (err)
die("Failed to create nftables chains or rules: %s (%s)", err, strerror(errno));
if (err) {
if (rtpe_config.no_fallback)
die("Failed to create nftables chains or rules: %s (%s)", err, strerror(errno));
ilog(LOG_ERR, "FAILED TO CREATE NFTABLES CHAINS OR RULES, KERNEL FORWARDING POSSIBLY WON'T WORK: "
"%s (%s)", err, strerror(errno));
}
#endif
if (!kernel_setup_table(rtpe_config.kernel_table) && rtpe_config.no_fallback)
die("Userspace fallback disallowed - exiting");
Expand Down

0 comments on commit ebf47f6

Please sign in to comment.