/** create a new localzone */
static struct local_zone*
-local_zone_create(struct local_zones* zones, uint8_t* nm, size_t len,
- int labs, enum localzone_type t, uint16_t dclass)
+local_zone_create(uint8_t* nm, size_t len, int labs,
+ enum localzone_type t, uint16_t dclass)
{
struct local_zone* z = (struct local_zone*)calloc(1, sizeof(*z));
if(!z) {
}
rbtree_init(&z->data, &local_data_cmp);
lock_protect(&z->lock, &z->parent, sizeof(*z)-sizeof(rbnode_t));
- lock_protect(&zones->lock, &z->node, sizeof(z->node));
- lock_protect(&zones->lock, &z->parent, sizeof(z->parent));
- lock_protect(&zones->lock, &z->name, sizeof(z->name));
- lock_protect(&zones->lock, &z->namelen, sizeof(z->namelen));
- lock_protect(&zones->lock, &z->namelabs, sizeof(z->namelabs));
- lock_protect(&zones->lock, &z->dclass, sizeof(z->dclass));
- (void)zones; /* avoid argument unused warning if no lock checks */
+ /* also the zones->lock protects node, parent, name*, class */
return z;
}
lz_enter_zone_dname(struct local_zones* zones, uint8_t* nm, size_t len,
int labs, enum localzone_type t, uint16_t c)
{
- struct local_zone* z = local_zone_create(zones, nm, len, labs, t, c);
+ struct local_zone* z = local_zone_create(nm, len, labs, t, c);
if(!z) {
log_err("out of memory");
return NULL;
enum localzone_type tp)
{
/* create */
- struct local_zone* z = local_zone_create(zones, name, len, labs, tp,
- dclass);
+ struct local_zone* z = local_zone_create(name, len, labs, tp, dclass);
if(!z) return NULL;
lock_rw_wrlock(&z->lock);
printf(" -s ip[@port] server address, if omitted config is used.\n");
printf(" -h show this usage help.\n");
printf("Commands:\n");
- printf(" start start server; runs unbound(8)\n");
- printf(" stop stops the server\n");
- printf(" reload reloads the server\n");
- printf(" stats print statistics\n");
+ printf(" start start server; runs unbound(8)\n");
+ printf(" stop stops the server\n");
+ printf(" reload reloads the server\n");
+ printf(" stats print statistics\n");
printf(" verbosity [number] change logging detail\n");
printf(" local_zone [name] [type] add new local zone\n");
printf(" local_zone_remove [name] remove local zone and its contents\n");
int c, ret;
char* cfgfile = CONFIGFILE;
char* svr = NULL;
+#ifdef USE_THREAD_DEBUG
+ /* stop the file output from unbound-control, overwites the servers */
+ extern int check_locking_order;
+ check_locking_order = 0;
+#endif /* USE_THREAD_DEBUG */
log_ident_set("unbound-control");
log_init(NULL, 0, NULL);
checklock_start();