From 40d6081485d6f3e39f325cede1cef48f225c9cdc Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 26 Dec 2019 20:58:39 +0100 Subject: Do not try to set up default gateway without an IP address If the container has no IP address (because it will be assigned via DHCP later), setting up a default route fails with a warning message. While this is harmless, the default route should be omitted instead. --- src/firejail/network_main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/firejail/network_main.c b/src/firejail/network_main.c index 6800bde8d..ad297efc7 100644 --- a/src/firejail/network_main.c +++ b/src/firejail/network_main.c @@ -246,6 +246,10 @@ void net_check_cfg(void) { if (cfg.defaultgw) check_default_gw(cfg.defaultgw); else { + // if the first network has no assigned address, + // do not try to set up a gateway, because it will fail + if (cfg.bridge0.arg_ip_none) + return; // first network is a regular bridge if (cfg.bridge0.macvlan == 0) cfg.defaultgw = cfg.bridge0.ip; -- cgit v1.2.3-54-g00ecf