mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 22:35:25 +00:00
- A bug was repaired in subencapsulation support, where spaces separated
by empty spaces would not get included. [ISC-Bugs #16805]
This commit is contained in:
3
RELNOTES
3
RELNOTES
@@ -34,6 +34,9 @@ the README file.
|
|||||||
which causes the server to abstain from performing updates on PTR
|
which causes the server to abstain from performing updates on PTR
|
||||||
records. Thanks to a patch from Christof Chen at Allianz.
|
records. Thanks to a patch from Christof Chen at Allianz.
|
||||||
|
|
||||||
|
- A bug was repaired in subencapsulation support, where spaces separated
|
||||||
|
by empty spaces would not get included.
|
||||||
|
|
||||||
Changes since 3.1.0a3
|
Changes since 3.1.0a3
|
||||||
|
|
||||||
- Some spelling fixes.
|
- Some spelling fixes.
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: options.c,v 1.104 2007/04/11 02:04:39 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
|
"$Id: options.c,v 1.105 2007/04/12 16:15:31 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#define DHCP_OPTION_DATA
|
#define DHCP_OPTION_DATA
|
||||||
@@ -664,13 +664,11 @@ int cons_options (inpacket, outpacket, lease, client_state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now go through all the universes for which options
|
/* Put any spaces that are encapsulated on the list,
|
||||||
were set and see if there are encapsulations for
|
* sort out wether they contain values later.
|
||||||
them; if there are, put the encapsulation options
|
*/
|
||||||
on the priority list as well. */
|
|
||||||
for (i = 0; i < cfg_options -> universe_count; i++) {
|
for (i = 0; i < cfg_options -> universe_count; i++) {
|
||||||
if (cfg_options -> universes [i] &&
|
if (universes[i]->enc_opt &&
|
||||||
universes [i] -> enc_opt &&
|
|
||||||
priority_len < PRIORITY_COUNT &&
|
priority_len < PRIORITY_COUNT &&
|
||||||
universes [i] -> enc_opt -> universe == &dhcp_universe)
|
universes [i] -> enc_opt -> universe == &dhcp_universe)
|
||||||
{
|
{
|
||||||
@@ -2218,34 +2216,54 @@ int option_space_encapsulate (result, packet, lease, client_state,
|
|||||||
log_error("encapsulation requested for %s with no support.",
|
log_error("encapsulation requested for %s with no support.",
|
||||||
name->data);
|
name->data);
|
||||||
|
|
||||||
/* Attempt to store any 'E'ncapsulated options that have not yet been
|
return status;
|
||||||
* placed on the option buffer by the above (configuring a value in
|
}
|
||||||
* the space over-rides any values in the child universe).
|
|
||||||
*
|
/* Attempt to store any 'E'ncapsulated options that have not yet been
|
||||||
* Note that there are far fewer universes than there will every be
|
* placed on the option buffer by the above (configuring a value in
|
||||||
* options in any universe. So it is faster to traverse the
|
* the space over-rides any values in the child universe).
|
||||||
* configured universes, checking if each is encapsulated in the
|
*
|
||||||
* current universe, and if so attempting to do so.
|
* Note that there are far fewer universes than there will every be
|
||||||
*
|
* options in any universe. So it is faster to traverse the
|
||||||
* For each configured universe for this configuration option space,
|
* configured universes, checking if each is encapsulated in the
|
||||||
* which is encapsulated within the current universe, can not be found
|
* current universe, and if so attempting to do so.
|
||||||
* by the lookup function (the universe-specific encapsulation
|
*
|
||||||
* functions would already have stored such a value), and encapsulates
|
* For each configured universe for this configuration option space,
|
||||||
* at least one option, append it.
|
* which is encapsulated within the current universe, can not be found
|
||||||
*/
|
* by the lookup function (the universe-specific encapsulation
|
||||||
|
* functions would already have stored such a value), and encapsulates
|
||||||
|
* at least one option, append it.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
search_subencapsulation(struct data_string *result, struct packet *packet,
|
||||||
|
struct lease *lease, struct client_state *client_state,
|
||||||
|
struct option_state *in_options,
|
||||||
|
struct option_state *cfg_options,
|
||||||
|
struct binding_scope **scope,
|
||||||
|
struct universe *universe)
|
||||||
|
{
|
||||||
|
struct data_string sub;
|
||||||
|
struct universe *subu;
|
||||||
|
int i, status = 0;
|
||||||
|
|
||||||
memset(&sub, 0, sizeof(sub));
|
memset(&sub, 0, sizeof(sub));
|
||||||
for (i = 0 ; i < cfg_options->universe_count ; i++) {
|
for (i = 0 ; i < cfg_options->universe_count ; i++) {
|
||||||
subu = universes[i];
|
subu = universes[i];
|
||||||
if (cfg_options->universes[i] != NULL &&
|
|
||||||
subu->enc_opt != NULL &&
|
if (subu == NULL)
|
||||||
subu->enc_opt->universe == u &&
|
log_fatal("Impossible condition at %s:%d.", MDL);
|
||||||
|
|
||||||
|
if (subu->enc_opt != NULL &&
|
||||||
|
subu->enc_opt->universe == universe &&
|
||||||
subu->enc_opt->format != NULL &&
|
subu->enc_opt->format != NULL &&
|
||||||
subu->enc_opt->format[0] == 'E' &&
|
subu->enc_opt->format[0] == 'E' &&
|
||||||
lookup_option(u, cfg_options,
|
lookup_option(universe, cfg_options,
|
||||||
subu->enc_opt->code) == NULL &&
|
subu->enc_opt->code) == NULL &&
|
||||||
subu->encapsulate(&sub, packet, lease, client_state,
|
subu->encapsulate(&sub, packet, lease, client_state,
|
||||||
in_options, cfg_options, scope, subu)) {
|
in_options, cfg_options,
|
||||||
if (append_option(result, u, subu->enc_opt, &sub))
|
scope, subu)) {
|
||||||
|
if (append_option(result, universe,
|
||||||
|
subu->enc_opt, &sub))
|
||||||
status = 1;
|
status = 1;
|
||||||
|
|
||||||
data_string_forget(&sub, MDL);
|
data_string_forget(&sub, MDL);
|
||||||
@@ -2291,6 +2309,10 @@ int hashed_option_space_encapsulate (result, packet, lease, client_state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (search_subencapsulation(result, packet, lease, client_state,
|
||||||
|
in_options, cfg_options, scope, universe))
|
||||||
|
status = 1;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2627,6 +2649,10 @@ int linked_option_space_encapsulate (result, packet, lease, client_state,
|
|||||||
status = 1;
|
status = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (search_subencapsulation(result, packet, lease, client_state,
|
||||||
|
in_options, cfg_options, scope, universe))
|
||||||
|
status = 1;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user