Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
8f4d5d80
Commit
8f4d5d80
authored
Apr 29, 2013
by
Marcin Siodelski
Browse files
[2902] Do not swap local and remote HW address when sending response.
parent
4f47c644
Changes
2
Show whitespace changes
Inline
Side-by-side
src/bin/dhcp4/dhcp4_srv.cc
View file @
8f4d5d80
...
...
@@ -375,12 +375,12 @@ Dhcpv4Srv::copyDefaultFields(const Pkt4Ptr& question, Pkt4Ptr& answer) {
// If src/dest HW addresses are used by the packet filtering class
// we need to copy them as well.
HWAddrPtr
src_hw_addr
=
question
->
getLocalHWAddr
();
HWAddrPtr
dst_hw_addr
=
question
->
getRemoteHWAddr
();
if
(
src_hw_addr
)
{
answer
->
set
Remote
HWAddr
(
src_hw_addr
);
answer
->
set
Local
HWAddr
(
src_hw_addr
);
}
HWAddrPtr
dst_hw_addr
=
question
->
getRemoteHWAddr
();
if
(
dst_hw_addr
)
{
answer
->
set
Local
HWAddr
(
dst_hw_addr
);
answer
->
set
Remote
HWAddr
(
dst_hw_addr
);
}
}
...
...
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
View file @
8f4d5d80
...
...
@@ -176,8 +176,8 @@ public:
// When processing an incoming packet the remote address
// is copied as a src address, and the source address is
// copied as a remote address to the response.
EXPECT_TRUE
(
q
->
getLocalHWAddr
()
==
a
->
get
Remote
HWAddr
());
EXPECT_TRUE
(
q
->
getRemoteHWAddr
()
==
a
->
get
Local
HWAddr
());
EXPECT_TRUE
(
q
->
getLocalHWAddr
()
==
a
->
get
Local
HWAddr
());
EXPECT_TRUE
(
q
->
getRemoteHWAddr
()
==
a
->
get
Remote
HWAddr
());
// Check that bare minimum of required options are there.
// We don't check options requested by a client. Those
...
...
Write
Preview
Supports
Markdown
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