+2110. [func] fdupont
+ A new boolean configuration flag called "never-send" has been
+ added to the option data scope. When enabled, the option is not
+ sent in a response to the client, even if the client explicitly
+ requests it.
+ (Gitlab #719)
+
2109. [bug] fdupont
Compatibility flags e.g. lenient-option-parsing were not
saved by config-get and similar commands.
responses on subnet ``192.0.3.0/24``. ``never-send`` has precedence over
``always-send`` so if both are true the option is not added.
+.. note::
+
+ The ``always-send`` and ``never-send`` flags are sticky, meaning
+ they do not follow the usual configuration inheritance rules.
+ Instead, if they are enabled at least once along the configuration
+ inheritance chain, they get applied regardless of them being
+ disabled in other places which would usually be more prioritized.
+ For instance, if one of the flags is enabled in the global scope,
+ but disabled at the subnet level, it will act as enabled,
+ disregarding the subnet-level setting.
+
.. note::
The ``never-send`` is less powerful than the :ref:`hooks-flex-option`,
Kea does not have such a mechanism, so it cannot send any sub-options on its own.
To solve this issue, we devised the concept of persistent options. Kea can be
told to always send options, even if the client did not request them. This can
-be achieved by adding ``"always-send": true`` to the option definition. Note
+be achieved by adding ``"always-send": true`` to the option data entry. Note
that in this particular case an option is defined in vendor space 25167. With
``always-send`` enabled, the option is sent every time there is a need to deal
with vendor space 25167.
on subnet ``2001:db8:1::/64``. ``never-send`` has precedence over
``always-send`` so if both are true the option is not added.
+.. note::
+
+ The ``always-send`` and ``never-send`` flags are sticky, meaning
+ they do not follow the usual configuration inheritance rules.
+ Instead, if they are enabled at least once along the configuration
+ inheritance chain, they get applied regardless of them being
+ disabled in other places which would usually be more prioritized.
+ For instance, if one of the flags is enabled in the global scope,
+ but disabled at the subnet level, it will act as enabled,
+ disregarding the subnet-level setting.
+
.. note::
The ``never-send`` is less powerful than the :ref:`hooks-flex-option`,
static_cast<void>(cancelled_opts.insert(code));
}
}
- }
+ }
// For each requested option code get the first instance of the option
// to be returned to the client.
#line 2013 "dhcp6_parser.yy"
{
ctx.unique("csv-format", ctx.loc2pos(yystack_[2].location));
- ElementPtr space(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("csv-format", space);
+ ElementPtr csv(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
+ ctx.stack_.back()->set("csv-format", csv);
}
#line 3235 "dhcp6_parser.cc"
break;
#line 2025 "dhcp6_parser.yy"
{
ctx.unique("never-send", ctx.loc2pos(yystack_[2].location));
- ElementPtr persist(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
- ctx.stack_.back()->set("never-send", persist);
+ ElementPtr cancel(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location)));
+ ctx.stack_.back()->set("never-send", cancel);
}
#line 3255 "dhcp6_parser.cc"
break;
option_data_csv_format: CSV_FORMAT COLON BOOLEAN {
ctx.unique("csv-format", ctx.loc2pos(@1));
- ElementPtr space(new BoolElement($3, ctx.loc2pos(@3)));
- ctx.stack_.back()->set("csv-format", space);
+ ElementPtr csv(new BoolElement($3, ctx.loc2pos(@3)));
+ ctx.stack_.back()->set("csv-format", csv);
};
option_data_always_send: ALWAYS_SEND COLON BOOLEAN {
option_data_never_send: NEVER_SEND COLON BOOLEAN {
ctx.unique("never-send", ctx.loc2pos(@1));
- ElementPtr persist(new BoolElement($3, ctx.loc2pos(@3)));
- ctx.stack_.back()->set("never-send", persist);
+ ElementPtr cancel(new BoolElement($3, ctx.loc2pos(@3)));
+ ctx.stack_.back()->set("never-send", cancel);
};
// ---- pools ------------------------------------