Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sebastian Schrader
Kea
Commits
5d98905f
Commit
5d98905f
authored
Feb 24, 2016
by
Shawn Routhier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[trac4292] Always copy the DHCPv4 flags field from the client's request to the server's response
parent
cea1469d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.cc
+2
-0
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
+2
-0
No files found.
src/bin/dhcp4/dhcp4_srv.cc
View file @
5d98905f
...
...
@@ -198,6 +198,8 @@ Dhcpv4Exchange::copyDefaultFields() {
if
(
dst_hw_addr
)
{
resp_
->
setRemoteHWAddr
(
dst_hw_addr
);
}
resp_
->
setFlags
(
query_
->
getFlags
());
}
void
...
...
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
View file @
5d98905f
...
...
@@ -395,6 +395,7 @@ TEST_F(Dhcpv4SrvTest, initResponse) {
const
HWAddr
&
dst_hw
=
HWAddr
::
fromText
(
"e8:ab:cd:78:9a:bc"
);
HWAddrPtr
dst_hw_addr
(
new
HWAddr
(
dst_hw
));
query
->
setRemoteHWAddr
(
dst_hw_addr
);
query
->
setFlags
(
BOOTP_BROADCAST
);
// Add options which must be copied
// client-id echo is optional
...
...
@@ -423,6 +424,7 @@ TEST_F(Dhcpv4SrvTest, initResponse) {
EXPECT_EQ
(
IOAddress
(
"10.10.10.10"
),
response
->
getGiaddr
());
EXPECT_TRUE
(
src_hw
==
*
response
->
getLocalHWAddr
());
EXPECT_TRUE
(
dst_hw
==
*
response
->
getRemoteHWAddr
());
EXPECT_TRUE
(
BOOTP_BROADCAST
==
response
->
getFlags
());
// Check options (i.e., subnet selection option)
OptionPtr
resp_sbnsel
=
response
->
getOption
(
DHO_SUBNET_SELECTION
);
...
...
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