Merge remote branch 'upstream/master' into bugfixes
authorHans Dedecker <hans.dedecker@technicolor.com>
Thu, 23 Jan 2014 08:49:42 +0000 (09:49 +0100)
committerHans Dedecker <hans.dedecker@technicolor.com>
Thu, 23 Jan 2014 08:49:42 +0000 (09:49 +0100)
src/config.c
src/dhcpv6-ia.c

index b6b3708..d025bdf 100644 (file)
@@ -560,7 +560,7 @@ void odhcpd_reload(void)
 
                enum odhcpd_mode hybrid_mode = RELAYD_DISABLED;
 #ifdef WITH_UBUS
-               if (ubus_has_prefix(i->name, i->ifname))
+               if (!ubus_has_prefix(i->name, i->ifname))
                        hybrid_mode = RELAYD_RELAY;
 #endif
 
index 2e93bd0..88840a4 100644 (file)
@@ -211,7 +211,7 @@ void dhcpv6_write_statefile(void)
                        if (iface->dhcpv6 != RELAYD_SERVER && iface->dhcpv4 != RELAYD_SERVER)
                                continue;
 
-                       if (iface->dhcpv6 == RELAYD_SERVER) {
+                       if (iface->dhcpv6 == RELAYD_SERVER && iface->ia_assignments.next) {
                                struct dhcpv6_assignment *c;
                                list_for_each_entry(c, &iface->ia_assignments, head) {
                                        if (c->clid_len == 0)
@@ -262,7 +262,7 @@ void dhcpv6_write_statefile(void)
                                }
                        }
 
-                       if (iface->dhcpv4 == RELAYD_SERVER) {
+                       if (iface->dhcpv4 == RELAYD_SERVER && iface->dhcpv4_assignments.next) {
                                struct dhcpv4_assignment *c;
                                list_for_each_entry(c, &iface->dhcpv4_assignments, head) {
                                        char ipbuf[INET6_ADDRSTRLEN];