Skip to content
GitLab
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
fedb6edd
Commit
fedb6edd
authored
May 21, 2012
by
JINMEI Tatuya
Browse files
[1539] use getSALength() instead of sa_len to calculate the length of sockaddr.
the latter isn't very portable.
parent
ad6c12af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/tests/auth_srv_unittest.cc
View file @
fedb6edd
...
...
@@ -16,6 +16,8 @@
#include
<gtest/gtest.h>
#include
<util/io/sockaddr_util.h>
#include
<dns/message.h>
#include
<dns/messagerenderer.h>
#include
<dns/name.h>
...
...
@@ -56,6 +58,7 @@ using namespace std;
using
namespace
isc
::
cc
;
using
namespace
isc
::
dns
;
using
namespace
isc
::
util
;
using
namespace
isc
::
util
::
io
::
internal
;
using
namespace
isc
::
util
::
unittests
;
using
namespace
isc
::
dns
::
rdata
;
using
namespace
isc
::
data
;
...
...
@@ -1428,7 +1431,7 @@ checkAddrPort(const struct sockaddr& actual_sa,
const
string
&
expected_addr
,
uint16_t
expected_port
)
{
char
hbuf
[
NI_MAXHOST
],
sbuf
[
NI_MAXSERV
];
const
int
error
=
getnameinfo
(
&
actual_sa
,
actual_sa
.
sa_len
,
hbuf
,
const
int
error
=
getnameinfo
(
&
actual_sa
,
getSALength
(
actual_sa
)
,
hbuf
,
sizeof
(
hbuf
),
sbuf
,
sizeof
(
sbuf
),
NI_NUMERICHOST
|
NI_NUMERICSERV
);
if
(
error
!=
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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