diff options
author | Ted Lemon <source@isc.org> | 2001-06-27 00:31:20 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2001-06-27 00:31:20 +0000 |
commit | d758ad8cac9c00c70cfe4dd459bf7e87c268c579 (patch) | |
tree | 85d7e10e40b0e1061a40f45ef0e9f44073346482 /server/class.c | |
parent | 07b958004f4e39f9b222115b1b050044a2434ea1 (diff) | |
download | isc-dhcp-d758ad8cac9c00c70cfe4dd459bf7e87c268c579.tar.gz |
Merge changes between 3.0rc7 and 3.0rc8pl2.
Diffstat (limited to 'server/class.c')
-rw-r--r-- | server/class.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/server/class.c b/server/class.c index 25160483..eab7d9e0 100644 --- a/server/class.c +++ b/server/class.c @@ -3,7 +3,7 @@ Handling for client classes. */ /* - * Copyright (c) 1998-2000 Internet Software Consortium. + * Copyright (c) 1998-2001 Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: class.c,v 1.30 2001/06/22 16:47:13 brister Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: class.c,v 1.31 2001/06/27 00:31:02 mellon Exp $ Copyright (c) 1998-2001 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ @@ -64,21 +64,20 @@ int have_billing_classes; void classification_setup () { - struct executable_statement *rules; - /* eval ... */ - rules = (struct executable_statement *)0; - if (!executable_statement_allocate (&rules, MDL)) + default_classification_rules = (struct executable_statement *)0; + if (!executable_statement_allocate (&default_classification_rules, + MDL)) log_fatal ("Can't allocate check of default collection"); - rules -> op = eval_statement; + default_classification_rules -> op = eval_statement; /* check-collection "default" */ - if (!expression_allocate (&rules -> data.eval, MDL)) + if (!expression_allocate (&default_classification_rules -> data.eval, + MDL)) log_fatal ("Can't allocate default check expression"); - rules -> data.eval -> op = expr_check; - rules -> data.eval -> data.check = &default_collection; - - default_classification_rules = rules; + default_classification_rules -> data.eval -> op = expr_check; + default_classification_rules -> data.eval -> data.check = + &default_collection; } void classify_client (packet) @@ -142,7 +141,7 @@ int check_collection (packet, lease, collection) (struct client_state *)0, packet -> options, (struct option_state *)0, lease ? &lease -> scope : &global_scope, - class -> submatch)); + class -> submatch, MDL)); if (status && data.len) { nc = (struct class *)0; if (class_hash_lookup (&nc, class -> hash, @@ -200,13 +199,14 @@ int check_collection (packet, lease, collection) MDL); data_string_forget (&data, MDL); if (!class -> hash) - class -> hash = new_hash (0, 0, 0); + class -> hash = new_hash (0, 0, 0, MDL); class_hash_add (class -> hash, (const char *) nc -> hash_string.data, nc -> hash_string.len, nc, MDL); classify (packet, nc); + class_dereference (&nc, MDL); } } } @@ -221,7 +221,7 @@ void classify (packet, class) class_reference (&packet -> classes [packet -> class_count++], class, MDL); else - log_error ("too many groups for %s", + log_error ("too many classes match %s", print_hw_addr (packet -> raw -> htype, packet -> raw -> hlen, packet -> raw -> chaddr)); |