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
ISC Open Source Projects
Kea
Commits
d5fbef09
Commit
d5fbef09
authored
Aug 21, 2017
by
Marcin Siodelski
Browse files
[5340] Fixed invalid use of Pkt4::setFile and Pkt4::setSname functions.
parent
0d05123d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/dhcp4_srv.cc
View file @
d5fbef09
...
...
@@ -401,14 +401,16 @@ Dhcpv4Exchange::setReservedMessageFields() {
resp_
->
setSiaddr
(
host
->
getNextServer
());
}
if
(
!
host
->
getServerHostname
().
empty
())
{
resp_
->
setSname
(
reinterpret_cast
<
const
uint8_t
*>
(
host
->
getServerHostname
().
c_str
()));
std
::
string
sname
=
host
->
getServerHostname
();
if
(
!
sname
.
empty
())
{
resp_
->
setSname
(
reinterpret_cast
<
const
uint8_t
*>
(
sname
.
c_str
()),
sname
.
size
());
}
if
(
!
host
->
getBootFileName
().
empty
())
{
resp_
->
setFile
(
reinterpret_cast
<
const
uint8_t
*>
(
host
->
getBootFileName
().
c_str
()));
std
::
string
bootfile
=
host
->
getBootFileName
();
if
(
!
bootfile
.
empty
())
{
resp_
->
setFile
(
reinterpret_cast
<
const
uint8_t
*>
(
bootfile
.
c_str
()),
bootfile
.
size
());
}
}
}
...
...
src/lib/dhcp/pkt4.h
View file @
d5fbef09
...
...
@@ -269,7 +269,7 @@ public:
///
/// @param sname value to be set
/// @param sname_len length of the sname buffer (up to MAX_SNAME_LEN)
void
setSname
(
const
uint8_t
*
sname
,
size_t
sname_len
=
MAX_SNAME_LEN
);
void
setSname
(
const
uint8_t
*
sname
,
size_t
sname_len
);
/// @brief Returns file field
///
...
...
@@ -285,7 +285,7 @@ public:
/// @param file value to be set
/// @param file_len length of the file buffer (up to MAX_FILE_LEN)
void
setFile
(
const
uint8_t
*
file
,
size_t
file_len
=
MAX_FILE_LEN
);
setFile
(
const
uint8_t
*
file
,
size_t
file_len
);
/// @brief Sets hardware address.
///
...
...
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