main: make failing ubus connection nonfatal
authorJo-Philipp Wich <jo@mein.io>
Sun, 6 Nov 2016 15:58:09 +0000 (16:58 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 6 Nov 2016 15:58:09 +0000 (16:58 +0100)
The ubus network runtime information is not strictly required to use firewall3,
so make a failing ubus connection nonfatal.

This allows testing and running firewall3 on an ordinary desktop linux system,
given an appropriate configuration which uses "option device" instead of
"option network" for zone declarations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
main.c

diff --git a/main.c b/main.c
index 347902a064864d944751aa243edc2a9a24614f2a..e38963d25268abdf6aa6eb8de0edde5bf1d0fa6c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -79,7 +79,7 @@ build_state(bool runtime)
        else
        {
                if (!fw3_ubus_connect())
-                       error("Failed to connect to ubus");
+                       warn("Failed to connect to ubus");
 
                if (uci_load(state->uci, "firewall", &p))
                {