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
61cd69fd
Commit
61cd69fd
authored
Apr 11, 2018
by
Francis Dupont
Browse files
[master] Fixed merge errors
parent
644526fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
View file @
61cd69fd
...
...
@@ -198,7 +198,8 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
// Add the client class definition
try
{
class_dictionary
->
addClass
(
name
,
match_expr
,
test
,
required
,
options
,
defs
,
next_server
,
sname
,
filename
);
defs
,
user_context
,
next_server
,
sname
,
filename
);
}
catch
(
const
std
::
exception
&
ex
)
{
isc_throw
(
DhcpConfigError
,
"Can't add class: "
<<
ex
.
what
()
<<
" ("
<<
class_def_cfg
->
getPosition
()
<<
")"
);
...
...
src/lib/dhcpsrv/parsers/shared_network_parser.cc
View file @
61cd69fd
...
...
@@ -73,6 +73,7 @@ SharedNetwork4Parser::parse(const data::ConstElementPtr& shared_network_data) {
ConstElementPtr
user_context
=
shared_network_data
->
get
(
"user-context"
);
if
(
user_context
)
{
shared_network
->
setContext
(
user_context
);
}
if
(
shared_network_data
->
contains
(
"require-client-classes"
))
{
const
std
::
vector
<
data
::
ElementPtr
>&
class_list
=
...
...
@@ -132,6 +133,7 @@ SharedNetwork6Parser::parse(const data::ConstElementPtr& shared_network_data) {
ConstElementPtr
user_context
=
shared_network_data
->
get
(
"user-context"
);
if
(
user_context
)
{
shared_network
->
setContext
(
user_context
);
}
if
(
shared_network_data
->
contains
(
"require-client-classes"
))
{
const
std
::
vector
<
data
::
ElementPtr
>&
class_list
=
...
...
src/lib/dhcpsrv/shared_network.cc
View file @
61cd69fd
...
...
@@ -208,7 +208,7 @@ public:
/// such subnet by inspecting "last allocation" timestamps. The one with most
/// recent timestamp is selected.
///
/// The preferred subnet must also fulfil the condition of equal client class
es
/// The preferred subnet must also fulfil the condition of equal client class
/// with the @c selected_subnet.
///
/// @param subnets Container holding subnets belonging to this shared
...
...
@@ -226,7 +226,7 @@ public:
auto
preferred_subnet
=
selected_subnet
;
for
(
auto
s
=
subnets
.
begin
();
s
!=
subnets
.
end
();
++
s
)
{
if
(((
*
s
)
->
getClientClass
es
()
==
selected_subnet
->
getClientClass
es
())
&&
if
(((
*
s
)
->
getClientClass
()
==
selected_subnet
->
getClientClass
())
&&
((
*
s
)
->
getLastAllocatedTime
(
lease_type
)
>
selected_subnet
->
getLastAllocatedTime
(
lease_type
)))
{
preferred_subnet
=
(
*
s
);
...
...
src/lib/dhcpsrv/testutils/host_data_source_utils.cc
View file @
61cd69fd
...
...
@@ -56,7 +56,7 @@ HostDataSourceUtils::generateIdentifier(const bool new_identifier) {
HostPtr
HostDataSourceUtils
::
initializeHost4
(
const
std
::
string
&
address
,
const
Host
::
IdentifierType
&
id
)
{
const
Host
::
IdentifierType
&
id
)
{
std
::
vector
<
uint8_t
>
ident
;
if
(
id
==
Host
::
IDENT_HWADDR
)
{
ident
=
generateHWAddr
();
...
...
@@ -80,9 +80,9 @@ HostDataSourceUtils::initializeHost4(const std::string& address,
HostPtr
HostDataSourceUtils
::
initializeHost6
(
std
::
string
address
,
Host
::
IdentifierType
identifier
,
bool
prefix
,
bool
new_identifier
)
{
Host
::
IdentifierType
identifier
,
bool
prefix
,
bool
new_identifier
)
{
std
::
vector
<
uint8_t
>
ident
;
switch
(
identifier
)
{
case
Host
::
IDENT_HWADDR
:
...
...
@@ -121,7 +121,7 @@ HostDataSourceUtils::initializeHost6(std::string address,
bool
HostDataSourceUtils
::
reservationExists
(
const
IPv6Resrv
&
resrv
,
const
IPv6ResrvRange
&
range
)
{
const
IPv6ResrvRange
&
range
)
{
for
(
IPv6ResrvIterator
it
=
range
.
first
;
it
!=
range
.
second
;
++
it
)
{
if
(
resrv
==
it
->
second
)
{
return
true
;
...
...
@@ -132,8 +132,8 @@ HostDataSourceUtils::reservationExists(const IPv6Resrv& resrv,
void
HostDataSourceUtils
::
compareHwaddrs
(
const
ConstHostPtr
&
host1
,
const
ConstHostPtr
&
host2
,
bool
expect_match
)
{
const
ConstHostPtr
&
host2
,
bool
expect_match
)
{
ASSERT_TRUE
(
host1
);
ASSERT_TRUE
(
host2
);
...
...
@@ -168,8 +168,8 @@ HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
void
HostDataSourceUtils
::
compareDuids
(
const
ConstHostPtr
&
host1
,
const
ConstHostPtr
&
host2
,
bool
expect_match
)
{
const
ConstHostPtr
&
host2
,
bool
expect_match
)
{
ASSERT_TRUE
(
host1
);
ASSERT_TRUE
(
host2
);
...
...
@@ -203,7 +203,7 @@ HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
void
HostDataSourceUtils
::
compareHosts
(
const
ConstHostPtr
&
host1
,
const
ConstHostPtr
&
host2
)
{
const
ConstHostPtr
&
host2
)
{
// Let's compare HW addresses and expect match.
compareHwaddrs
(
host1
,
host2
,
true
);
...
...
@@ -251,7 +251,7 @@ HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
void
HostDataSourceUtils
::
compareReservations6
(
IPv6ResrvRange
resrv1
,
IPv6ResrvRange
resrv2
)
{
IPv6ResrvRange
resrv2
)
{
// Compare number of reservations for both hosts
if
(
std
::
distance
(
resrv1
.
first
,
resrv1
.
second
)
!=
std
::
distance
(
resrv2
.
first
,
resrv2
.
second
))
{
...
...
@@ -303,13 +303,13 @@ HostDataSourceUtils::compareReservations6(IPv6ResrvRange resrv1,
void
HostDataSourceUtils
::
compareClientClasses
(
const
ClientClasses
&
classes1
,
const
ClientClasses
&
classes2
)
{
EXPECT_TRUE
(
std
::
equal
(
classes1
.
begin
(),
classes1
.
end
(),
classes2
.
begin
()));
const
ClientClasses
&
classes2
)
{
EXPECT_TRUE
(
std
::
equal
(
classes1
.
c
begin
(),
classes1
.
c
end
(),
classes2
.
c
begin
()));
}
void
HostDataSourceUtils
::
compareOptions
(
const
ConstCfgOptionPtr
&
cfg1
,
const
ConstCfgOptionPtr
&
cfg2
)
{
const
ConstCfgOptionPtr
&
cfg2
)
{
ASSERT_TRUE
(
cfg1
);
ASSERT_TRUE
(
cfg2
);
...
...
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