diff --git a/src/util.cpp b/src/util.cpp
index cad1ed8..7f55e2e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "util.hpp"
 
 #include "config_parser.hpp"
@@ -366,6 +368,12 @@
 
 bool getIPv6AcceptRA(const config::Parser& config)
 {
+#ifdef ENABLE_IPV6_ACCEPT_RA
+    constexpr bool def = true;
+#else
+    constexpr bool def = false;
+#endif
+
     auto value = config.map.getLastValueString("Network", "IPv6AcceptRA");
     if (value == nullptr)
     {
@@ -374,7 +382,7 @@
             config.getFilename().native());
         log<level::NOTICE>(msg.c_str(),
                            entry("FILE=%s", config.getFilename().c_str()));
-        return false;
+        return def;
     }
     auto ret = config::parseBool(*value);
     if (!ret.has_value())
@@ -386,11 +394,13 @@
                            entry("FILE=%s", config.getFilename().c_str()),
                            entry("VALUE=%s", value->c_str()));
     }
-    return ret.value_or(false);
+    return ret.value_or(def);
 }
 
 EthernetInterfaceIntf::DHCPConf getDHCPValue(const config::Parser& config)
 {
+    constexpr auto def = EthernetInterfaceIntf::DHCPConf::both;
+
     const auto value = config.map.getLastValueString("Network", "DHCP");
     if (value == nullptr)
     {
@@ -399,7 +409,7 @@
                         config.getFilename().native());
         log<level::NOTICE>(msg.c_str(),
                            entry("FILE=%s", config.getFilename().c_str()));
-        return EthernetInterfaceIntf::DHCPConf::none;
+        return def;
     }
     if (config::icaseeq(*value, "ipv4"))
     {
@@ -417,9 +427,10 @@
         log<level::NOTICE>(str.c_str(),
                            entry("FILE=%s", config.getFilename().c_str()),
                            entry("VALUE=%s", value->c_str()));
+        return def;
     }
-    return ret.value_or(false) ? EthernetInterfaceIntf::DHCPConf::both
-                               : EthernetInterfaceIntf::DHCPConf::none;
+    return *ret ? EthernetInterfaceIntf::DHCPConf::both
+                : EthernetInterfaceIntf::DHCPConf::none;
 }
 
 namespace mac_address
