Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adam Osuchowski
Kea
Commits
2b15e02a
Commit
2b15e02a
authored
Oct 24, 2013
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[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
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.cc
+3
-3
No files found.
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