diff options
author | Kozlov Dmitry <dima@server> | 2011-08-24 15:13:42 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-08-24 15:13:42 +0400 |
commit | 9193e4e597b058ab143987e40797a6bb2b3a20e4 (patch) | |
tree | 99d102dc8f13c7e0a1776790291e45a3596b3d79 /accel-pppd/extra/ipv6pool.c | |
parent | 4f9a2df99cd4dbc4724bfef9676383fad2707598 (diff) | |
download | accel-ppp-xebd-9193e4e597b058ab143987e40797a6bb2b3a20e4.tar.gz accel-ppp-xebd-9193e4e597b058ab143987e40797a6bb2b3a20e4.zip |
ipv6pool: fix incorrect item initialization
Diffstat (limited to 'accel-pppd/extra/ipv6pool.c')
-rw-r--r-- | accel-pppd/extra/ipv6pool.c | 4 |
1 files 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; } |