X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fippool.c;h=58a0d2812a9548cfb2e29dc3b7d5729eac38d9c0;hb=230905c20905f2bc5ccf4b8fab75c1b5df2ac31d;hp=065c27867384e9894581bb99303fea3178a45666;hpb=d1ddd581e699333cd5eea06ebf8caf96890e2b74;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/ippool.c b/src/ippool.c index 065c278..58a0d28 100644 --- a/src/ippool.c +++ b/src/ippool.c @@ -296,7 +296,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 +323,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; } @@ -353,12 +353,16 @@ struct connman_ippool *__connman_ippool_create(int index, * The range is at max 255 and we don't support overlapping * blocks. */ - if (start + range > 254) + if (start + range > 254) { + connman_error("IP pool does not support pool size larger than 254"); return NULL; + } block = get_free_block(start + range); - if (block == 0) + if (block == 0) { + connman_warn("Could not find a free IP block"); return NULL; + } pool = g_try_new0(struct connman_ippool, 1); if (pool == NULL)