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
445
Issues
445
List
Boards
Labels
Service Desk
Milestones
Merge Requests
71
Merge Requests
71
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
ISC Open Source Projects
Kea
Commits
f6d9630e
Commit
f6d9630e
authored
Dec 29, 2014
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[3548] Compilation fix.
parent
27441216
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
doc/guide/dhcp6-srv.xml
doc/guide/dhcp6-srv.xml
+3
-2
src/lib/dhcp/pkt.cc
src/lib/dhcp/pkt.cc
+5
-5
src/lib/dhcp/tests/pkt6_unittest.cc
src/lib/dhcp/tests/pkt6_unittest.cc
+4
-4
No files found.
doc/guide/dhcp6-srv.xml
View file @
f6d9630e
...
...
@@ -1884,9 +1884,10 @@ should include options from the isc option space:
</simpara>
</listitem>
<listitem>
<simpara><command>
raw
</command>
In principle, a DHCPv6 server could use raw
<simpara><command>
raw
</command>
-
In principle, a DHCPv6 server could use raw
sockets to receive incoming traffic and extract MAC/hardware address
information. This is currently not implemented and this value has no effect.
information. This is currently not implemented for DHCPv6 and this value has
no effect.
</simpara>
</listitem>
<listitem>
...
...
src/lib/dhcp/pkt.cc
View file @
f6d9630e
...
...
@@ -142,11 +142,11 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 2: From client link-layer address option inserted by a relay
if
(
hw_addr_src
&
HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
)
{
if
(
hw_addr_src
&
HWA
ddr
::
HWA
DDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
)
{
mac
=
getMACFromIPv6RelayOpt
();
if
(
mac
)
{
return
(
mac
);
}
else
if
(
hw_addr_src
==
HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
)
{
}
else
if
(
hw_addr_src
==
HWA
ddr
::
HWA
DDR_SOURCE_CLIENT_ADDR_RELAY_OPTION
)
{
// If we're interested only in RFC6939 link layer address as source
// of that info, there's no point in trying other options.
return
(
HWAddrPtr
());
...
...
@@ -154,11 +154,11 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 3: Extracted from DUID-LLT or DUID-LL
if
(
hw_addr_src
&
HWADDR_SOURCE_DUID
)
{
if
(
hw_addr_src
&
HWA
ddr
::
HWA
DDR_SOURCE_DUID
)
{
mac
=
getMACFromDUID
();
if
(
mac
)
{
return
(
mac
);
}
else
if
(
hw_addr_src
==
HWADDR_SOURCE_DUID
)
{
}
else
if
(
hw_addr_src
==
HWA
ddr
::
HWA
DDR_SOURCE_DUID
)
{
// If the only source allowed is DUID then we can skip the other
// methods.
return
(
HWAddrPtr
());
...
...
@@ -166,7 +166,7 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 4: Extracted from source IPv6 link-local address
if
(
hw_addr_src
&
HW
a
ddr
::
HWADDR_SOURCE_IPV6_LINK_LOCAL
)
{
if
(
hw_addr_src
&
HW
A
ddr
::
HWADDR_SOURCE_IPV6_LINK_LOCAL
)
{
mac
=
getMACFromSrcLinkLocalAddr
();
if
(
mac
)
{
return
(
mac
);
...
...
src/lib/dhcp/tests/pkt6_unittest.cc
View file @
f6d9630e
...
...
@@ -1161,18 +1161,18 @@ TEST_F(Pkt6Test, getMACFromDUID) {
duid_en
,
duid_en
+
sizeof
(
duid_en
))));
// Packet does not have any client-id, this call should fail
EXPECT_FALSE
(
pkt
.
getMAC
(
Pkt
::
HWADDR_SOURCE_DUID
));
EXPECT_FALSE
(
pkt
.
getMAC
(
HWAddr
::
HWADDR_SOURCE_DUID
));
// Let's test DUID-LLT. This should work.
pkt
.
addOption
(
clientid1
);
HWAddrPtr
mac
=
pkt
.
getMAC
(
Pkt
::
HWADDR_SOURCE_DUID
);
HWAddrPtr
mac
=
pkt
.
getMAC
(
HWAddr
::
HWADDR_SOURCE_DUID
);
ASSERT_TRUE
(
mac
);
EXPECT_EQ
(
"hwtype=7 0a:0b:0c:0d:0e:0f:10"
,
mac
->
toText
(
true
));
// Let's test DUID-LL. This should work.
ASSERT_TRUE
(
pkt
.
delOption
(
D6O_CLIENTID
));
pkt
.
addOption
(
clientid2
);
mac
=
pkt
.
getMAC
(
Pkt
::
HWADDR_SOURCE_DUID
);
mac
=
pkt
.
getMAC
(
HWAddr
::
HWADDR_SOURCE_DUID
);
ASSERT_TRUE
(
mac
);
EXPECT_EQ
(
"hwtype=11 0a:0b:0c:0d:0e"
,
mac
->
toText
(
true
));
...
...
@@ -1180,7 +1180,7 @@ TEST_F(Pkt6Test, getMACFromDUID) {
// contain any MAC address information.
ASSERT_TRUE
(
pkt
.
delOption
(
D6O_CLIENTID
));
pkt
.
addOption
(
clientid3
);
EXPECT_FALSE
(
pkt
.
getMAC
(
Pkt
::
HWADDR_SOURCE_DUID
));
EXPECT_FALSE
(
pkt
.
getMAC
(
HWAddr
::
HWADDR_SOURCE_DUID
));
}
}
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