mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Merge changes between 3.0rc7 and 3.0rc8pl2.
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user