diff options
| author | Ollivier Robert <roberto@FreeBSD.org> | 2013-12-04 21:33:17 +0000 |
|---|---|---|
| committer | Ollivier Robert <roberto@FreeBSD.org> | 2013-12-04 21:33:17 +0000 |
| commit | 2b45e011ca352ce509bc83ae148230aeee0c7e0d (patch) | |
| tree | a618007bb41d13153794a598e3d904ace2976324 /libntp/refnumtoa.c | |
| parent | 9b5bd0a264b0a21eefac2b929b574c73bd601507 (diff) | |
Diffstat (limited to 'libntp/refnumtoa.c')
| -rw-r--r-- | libntp/refnumtoa.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libntp/refnumtoa.c b/libntp/refnumtoa.c index 7c5d96e1e222..c52bc28b6389 100644 --- a/libntp/refnumtoa.c +++ b/libntp/refnumtoa.c @@ -3,13 +3,13 @@ */ #include <stdio.h> -#include "ntp_fp.h" +#include "ntp_net.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" char * refnumtoa( - struct sockaddr_storage* num + sockaddr_u *num ) { register u_int32 netnum; @@ -18,19 +18,19 @@ refnumtoa( LIB_GETBUF(buf); - if(num->ss_family == AF_INET) { - netnum = ntohl(((struct sockaddr_in*)num)->sin_addr.s_addr); + if (ISREFCLOCKADR(num)) { + netnum = SRCADR(num); rclock = clockname((int)((u_long)netnum >> 8) & 0xff); if (rclock != NULL) - (void)sprintf(buf, "%s(%lu)", rclock, (u_long)netnum & 0xff); + snprintf(buf, LIB_BUFLENGTH, "%s(%lu)", + rclock, (u_long)netnum & 0xff); else - (void)sprintf(buf, "REFCLK(%lu,%lu)", - ((u_long)netnum >> 8) & 0xff, (u_long)netnum & 0xff); + snprintf(buf, LIB_BUFLENGTH, "REFCLK(%lu,%lu)", + ((u_long)netnum >> 8) & 0xff, + (u_long)netnum & 0xff); } - else { - (void)sprintf(buf, "refclock address type not implemented yet, use IPv4 refclock address."); - } + return buf; } |
