dundee: Watch for signals only on DUNDEE_SERVICE
[framework/connectivity/connman.git] / src / ippool.c
index 968d20f..52446ce 100644 (file)
@@ -258,7 +258,11 @@ void __connman_ippool_newaddr(int index, const char *address,
        if (is_private_address(start) == FALSE)
                return;
 
-       mask = ~(0xffffffff >> prefixlen);
+       if (prefixlen >= 32)
+               mask = 0xffffffff;
+       else
+               mask = ~(0xffffffff >> prefixlen);
+
        start = start & mask;
        end = start | ~mask;
 
@@ -296,7 +300,7 @@ update:
                if (!(it->start <= info->start || info->start <= it->end))
                        continue;
 
-               if (it->pool->collision_cb != NULL)
+               if (it->pool != NULL && it->pool->collision_cb != NULL)
                        it->pool->collision_cb(it->pool, it->pool->user_data);
 
                return;
@@ -323,7 +327,7 @@ void __connman_ippool_deladdr(int index, const char *address,
        info = lookup_info(index, start);
        if (info == NULL) {
                /* In theory this should never happen */
-               connman_error("Inconsisten IP pool management (start not found)");
+               connman_error("Inconsistent IP pool management (start not found)");
                return;
        }