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
ISC Open Source Projects
Kea
Commits
e05819fb
Commit
e05819fb
authored
Dec 03, 2015
by
Tomek Mrugalski
🛰
Browse files
[4217] HostMgr now uses exactly one identifier in get4() query
- Includes fix in AllocEngine6Test ctor, provided by Thomas
parent
599edbc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/host_mgr.cc
View file @
e05819fb
...
...
@@ -104,7 +104,12 @@ HostMgr::get4(const SubnetID& subnet_id, const HWAddrPtr& hwaddr,
.
arg
(
subnet_id
)
.
arg
(
hwaddr
?
hwaddr
->
toText
()
:
"(no-hwaddr)"
)
.
arg
(
duid
?
duid
->
toText
()
:
"(duid)"
);
host
=
alternate_source_
->
get4
(
subnet_id
,
hwaddr
,
duid
);
if
(
duid
)
{
host
=
alternate_source_
->
get4
(
subnet_id
,
HWAddrPtr
(),
duid
);
}
if
(
!
host
&&
hwaddr
)
{
host
=
alternate_source_
->
get4
(
subnet_id
,
hwaddr
,
DuidPtr
());
}
}
return
(
host
);
}
...
...
@@ -134,7 +139,12 @@ HostMgr::get6(const SubnetID& subnet_id, const DuidPtr& duid,
.
arg
(
subnet_id
)
.
arg
(
duid
?
duid
->
toText
()
:
"(duid)"
)
.
arg
(
hwaddr
?
hwaddr
->
toText
()
:
"(no-hwaddr)"
);
host
=
alternate_source_
->
get6
(
subnet_id
,
duid
,
hwaddr
);
if
(
duid
)
{
host
=
alternate_source_
->
get6
(
subnet_id
,
duid
,
HWAddrPtr
());
}
if
(
!
host
&&
hwaddr
)
{
host
=
alternate_source_
->
get6
(
subnet_id
,
DuidPtr
(),
hwaddr
);
}
}
return
(
host
);
}
...
...
src/lib/dhcpsrv/mysql_host_data_source.cc
View file @
e05819fb
...
...
@@ -867,7 +867,7 @@ MySqlHostDataSource::get6(const SubnetID& subnet_id, const DuidPtr& duid,
inbind
[
0
].
buffer
=
reinterpret_cast
<
char
*>
(
&
subnet_buffer
);
inbind
[
0
].
is_unsigned
=
MLM_TRUE
;
/// @todo: Rethink the logic in BaseHostDataSource::get
4
(subnet, hwaddr, duid)
/// @todo: Rethink the logic in BaseHostDataSource::get
6
(subnet, hwaddr, duid)
if
(
hwaddr
&&
duid
)
{
isc_throw
(
BadValue
,
"MySQL host data source get6() called with both"
" hwaddr and duid, only one of them is allowed"
);
...
...
src/lib/dhcpsrv/tests/alloc_engine_utils.cc
View file @
e05819fb
...
...
@@ -134,6 +134,9 @@ AllocEngine6Test::AllocEngine6Test() {
duid_
=
DuidPtr
(
new
DUID
(
std
::
vector
<
uint8_t
>
(
8
,
0x42
)));
iaid_
=
42
;
// Create fresh instance of the HostMgr, and drop any previous HostMgr state.
HostMgr
::
instance
().
create
();
// Let's use odd hardware type to check if there is no Ethernet
// hardcoded anywhere.
const
uint8_t
mac
[]
=
{
0
,
1
,
22
,
33
,
44
,
55
};
...
...
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