From 9193e4e597b058ab143987e40797a6bb2b3a20e4 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Wed, 24 Aug 2011 15:13:42 +0400 Subject: ipv6pool: fix incorrect item initialization --- accel-pppd/extra/ipv6pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel-pppd/extra/ipv6pool.c b/accel-pppd/extra/ipv6pool.c index 4380d47..8fe8ce2 100644 --- a/accel-pppd/extra/ipv6pool.c +++ b/accel-pppd/extra/ipv6pool.c @@ -38,6 +38,7 @@ static void generate_pool(struct in6_addr *addr, int mask, int prefix_len) for (; ip <= endip; ip += step) { it = malloc(sizeof(*it)); + it->it.owner = &ipdb; INIT_LIST_HEAD(&it->it.addr_list); INIT_LIST_HEAD(&it->it.route_list); a = malloc(sizeof(*a)); @@ -102,11 +103,10 @@ static struct ipv6db_item_t *get_ip(struct ppp_t *ppp) if (!list_empty(&ippool)) { it = list_entry(ippool.next, typeof(*it), entry); list_del(&it->entry); + it->it.intf_id = 0; } else it = NULL; spin_unlock(&pool_lock); - - it->it.intf_id = 0; return it ? &it->it : NULL; } -- cgit v1.2.3