projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbabad0
)
ntpd plugin: Pass a `struct sockaddr' to `getnameinfo', rather than a `struct in_addr'.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 1 Nov 2006 08:43:35 +0000
(09:43 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 1 Nov 2006 08:43:35 +0000
(09:43 +0100)
Thanks to Lubos Stanek for pointing me in the right direction :)
src/ntpd.c
patch
|
blob
|
history
diff --git
a/src/ntpd.c
b/src/ntpd.c
index
fc76a24
..
d65d1ed
100644
(file)
--- a/
src/ntpd.c
+++ b/
src/ntpd.c
@@
-897,8
+897,15
@@
static void ntpd_read (void)
if (ptr->v6_flag)
{
- status = getnameinfo ((const struct sockaddr *) &ptr->srcadr6,
- sizeof (ptr->srcadr6),
+ struct sockaddr_in6 sa;
+
+ memset (&sa, 0, sizeof (sa));
+ sa.sin6_family = AF_INET6;
+ sa.sin6_port = htons (123);
+ memcpy (&sa.sin6_addr, &ptr->srcadr6, sizeof (struct in6_addr));
+
+ status = getnameinfo ((const struct sockaddr *) &sa,
+ sizeof (sa),
peername, sizeof (peername),
NULL, 0, 0 /* no flags */);
if (status != 0)