55a56,58
> #if defined(SOLARIS2) && !defined(_KERNEL)
> # include "radix_ipf.h"
> #endif
78c81
< static const char rcsid[] = "@(#)$Id: ip_pool.c,v 2.55.2.20 2007/05/31 12:27:35 darrenr Exp $";
---
> static const char rcsid[] = "@(#)$Id: ip_pool.c,v 2.55.2.24 2007/10/10 09:45:37 darrenr Exp $";
83c86,89
< # ifndef RADIX_NODE_HEAD_LOCK
---
> # if !defined(RADIX_NODE_HEAD_LOCK) || !defined(RADIX_NODE_HEAD_UNLOCK) || \
> !defined(_KERNEL)
> # undef RADIX_NODE_HEAD_LOCK
> # undef RADIX_NODE_HEAD_UNLOCK
85,86d90
< # endif
< # ifndef RADIX_NODE_HEAD_UNLOCK
267,268d270
< ASSERT(rw_read_locked(&ipf_global.ipf_lk) == 0);
<
466,467d467
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
532,533d531
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
536c534
< if ((op->iplo_arg & LOOKUP_ANON) == 0)
---
> if ((op->iplo_arg & LOOKUP_ANON) == 0) {
538,542c536,538
< else
< h = NULL;
<
< if (h != NULL) {
< if ((h->ipo_flags & IPOOL_DELETE) != 0) {
---
> if (h != NULL) {
> if ((h->ipo_flags & IPOOL_DELETE) == 0)
> return EEXIST;
546,551c542
< return EEXIST;
< } else {
< KMALLOC(h, ip_pool_t *);
< if (h == NULL)
< return ENOMEM;
< bzero(h, sizeof(*h));
---
> }
553,557c544,552
< if (rn_inithead((void **)&h->ipo_head,
< offsetof(addrfamily_t, adf_addr) << 3) == 0) {
< KFREE(h);
< return ENOMEM;
< }
---
> KMALLOC(h, ip_pool_t *);
> if (h == NULL)
> return ENOMEM;
> bzero(h, sizeof(*h));
>
> if (rn_inithead((void **)&h->ipo_head,
> offsetof(addrfamily_t, adf_addr) << 3) == 0) {
> KFREE(h);
> return ENOMEM;
592,600c587,594
< if ((h->ipo_flags & IPOOL_DELETE) == 0) {
< h->ipo_ref = 1;
< h->ipo_list = NULL;
< h->ipo_unit = unit;
< h->ipo_next = ip_pool_list[unit];
< if (ip_pool_list[unit] != NULL)
< ip_pool_list[unit]->ipo_pnext = &h->ipo_next;
< h->ipo_pnext = &ip_pool_list[unit];
< ip_pool_list[unit] = h;
---
> h->ipo_ref = 1;
> h->ipo_list = NULL;
> h->ipo_unit = unit;
> h->ipo_next = ip_pool_list[unit];
> if (ip_pool_list[unit] != NULL)
> ip_pool_list[unit]->ipo_pnext = &h->ipo_next;
> h->ipo_pnext = &ip_pool_list[unit];
> ip_pool_list[unit] = h;
602,603c596
< ipoolstat.ipls_pools++;
< }
---
> ipoolstat.ipls_pools++;
623,624d615
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
792,793d782
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
861,862c850
< if (nextipo->ipo_next == NULL)
< token->ipt_alive = 0;
---
> token->ipt_data = nextipo;
865a854
> token->ipt_data = NULL;
885,886c874
< if (nextnode->ipn_next == NULL)
< token->ipt_alive = 0;
---
> token->ipt_data = nextnode;
889a878
> token->ipt_data = NULL;
910d898
< token->ipt_data = nextipo;
922d909
< token->ipt_data = nextnode;
> #if defined(SOLARIS2) && !defined(_KERNEL)
> # include "radix_ipf.h"
> #endif
78c81
< static const char rcsid[] = "@(#)$Id: ip_pool.c,v 2.55.2.20 2007/05/31 12:27:35 darrenr Exp $";
---
> static const char rcsid[] = "@(#)$Id: ip_pool.c,v 2.55.2.24 2007/10/10 09:45:37 darrenr Exp $";
83c86,89
< # ifndef RADIX_NODE_HEAD_LOCK
---
> # if !defined(RADIX_NODE_HEAD_LOCK) || !defined(RADIX_NODE_HEAD_UNLOCK) || \
> !defined(_KERNEL)
> # undef RADIX_NODE_HEAD_LOCK
> # undef RADIX_NODE_HEAD_UNLOCK
85,86d90
< # endif
< # ifndef RADIX_NODE_HEAD_UNLOCK
267,268d270
< ASSERT(rw_read_locked(&ipf_global.ipf_lk) == 0);
<
466,467d467
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
532,533d531
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
536c534
< if ((op->iplo_arg & LOOKUP_ANON) == 0)
---
> if ((op->iplo_arg & LOOKUP_ANON) == 0) {
538,542c536,538
< else
< h = NULL;
<
< if (h != NULL) {
< if ((h->ipo_flags & IPOOL_DELETE) != 0) {
---
> if (h != NULL) {
> if ((h->ipo_flags & IPOOL_DELETE) == 0)
> return EEXIST;
546,551c542
< return EEXIST;
< } else {
< KMALLOC(h, ip_pool_t *);
< if (h == NULL)
< return ENOMEM;
< bzero(h, sizeof(*h));
---
> }
553,557c544,552
< if (rn_inithead((void **)&h->ipo_head,
< offsetof(addrfamily_t, adf_addr) << 3) == 0) {
< KFREE(h);
< return ENOMEM;
< }
---
> KMALLOC(h, ip_pool_t *);
> if (h == NULL)
> return ENOMEM;
> bzero(h, sizeof(*h));
>
> if (rn_inithead((void **)&h->ipo_head,
> offsetof(addrfamily_t, adf_addr) << 3) == 0) {
> KFREE(h);
> return ENOMEM;
592,600c587,594
< if ((h->ipo_flags & IPOOL_DELETE) == 0) {
< h->ipo_ref = 1;
< h->ipo_list = NULL;
< h->ipo_unit = unit;
< h->ipo_next = ip_pool_list[unit];
< if (ip_pool_list[unit] != NULL)
< ip_pool_list[unit]->ipo_pnext = &h->ipo_next;
< h->ipo_pnext = &ip_pool_list[unit];
< ip_pool_list[unit] = h;
---
> h->ipo_ref = 1;
> h->ipo_list = NULL;
> h->ipo_unit = unit;
> h->ipo_next = ip_pool_list[unit];
> if (ip_pool_list[unit] != NULL)
> ip_pool_list[unit]->ipo_pnext = &h->ipo_next;
> h->ipo_pnext = &ip_pool_list[unit];
> ip_pool_list[unit] = h;
602,603c596
< ipoolstat.ipls_pools++;
< }
---
> ipoolstat.ipls_pools++;
623,624d615
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
792,793d782
< ASSERT(rw_read_locked(&ip_poolrw.ipf_lk) == 0);
<
861,862c850
< if (nextipo->ipo_next == NULL)
< token->ipt_alive = 0;
---
> token->ipt_data = nextipo;
865a854
> token->ipt_data = NULL;
885,886c874
< if (nextnode->ipn_next == NULL)
< token->ipt_alive = 0;
---
> token->ipt_data = nextnode;
889a878
> token->ipt_data = NULL;
910d898
< token->ipt_data = nextipo;
922d909
< token->ipt_data = nextnode;