Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
2b15e02a
Commit
2b15e02a
authored
Oct 24, 2013
by
Marcin Siodelski
Browse files
[3194] Append requested vendor options only if the lease is assigned.
Also, fix getting requested option codes from ORO.
parent
faea98cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/dhcp4_srv.cc
View file @
2b15e02a
...
...
@@ -683,7 +683,7 @@ Dhcpv4Srv::appendRequestedVendorOptions(const Pkt4Ptr& question, Pkt4Ptr& answer
// Get the list of options that client requested.
bool
added
=
false
;
const
std
::
vector
<
uint8_t
>&
requested_opts
=
oro
->
get
Data
();
const
std
::
vector
<
uint8_t
>&
requested_opts
=
oro
->
get
Values
();
for
(
std
::
vector
<
uint8_t
>::
const_iterator
code
=
requested_opts
.
begin
();
code
!=
requested_opts
.
end
();
++
code
)
{
...
...
@@ -914,13 +914,13 @@ Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
copyDefaultFields
(
discover
,
offer
);
appendDefaultOptions
(
offer
,
DHCPOFFER
);
appendRequestedVendorOptions
(
discover
,
offer
);
assignLease
(
discover
,
offer
);
// Adding any other options makes sense only when we got the lease.
if
(
offer
->
getYiaddr
()
!=
IOAddress
(
"0.0.0.0"
))
{
appendRequestedOptions
(
discover
,
offer
);
appendRequestedVendorOptions
(
discover
,
offer
);
// There are a few basic options that we always want to
// include in the response. If client did not request
// them we append them for him.
...
...
@@ -941,7 +941,6 @@ Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
copyDefaultFields
(
request
,
ack
);
appendDefaultOptions
(
ack
,
DHCPACK
);
appendRequestedVendorOptions
(
request
,
ack
);
// Note that we treat REQUEST message uniformly, regardless if this is a
// first request (requesting for new address), renewing existing address
...
...
@@ -951,6 +950,7 @@ Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
// Adding any other options makes sense only when we got the lease.
if
(
ack
->
getYiaddr
()
!=
IOAddress
(
"0.0.0.0"
))
{
appendRequestedOptions
(
request
,
ack
);
appendRequestedVendorOptions
(
request
,
ack
);
// There are a few basic options that we always want to
// include in the response. If client did not request
// them we append them for him.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment