From: Dave Hart Date: Thu, 12 Nov 2009 13:37:43 +0000 (+0000) Subject: [Bug 1343] sntp illegal C does not compile on Solaris 7. X-Git-Tag: NTP_4_2_5P245_RC~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ade21d5b1f1459095311baf44139fbc5a470a47;p=thirdparty%2Fntp.git [Bug 1343] sntp illegal C does not compile on Solaris 7. Windows VC9/VS2008: use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. bk: 4afc0fa7tBFI3Xrq1mAHctGB734g0g --- diff --git a/ChangeLog b/ChangeLog index 36d4c785f..79b78a545 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1343] sntp illegal C does not compile on Solaris 7. (4.2.5p244-RC) 2009/11/12 Released by Harlan Stenn * keygen.html updates from Dave Mills. * [Bug 1003] ntpdc unconfig command doesn't prompt for keyid. diff --git a/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj b/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj index cb0cff7fd..d2a4dd2d5 100644 --- a/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj +++ b/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj @@ -77,7 +77,7 @@ /> ai_addr, host->ai_addrlen, addr_buf, sizeof(addr_buf), NULL, 0, NI_NUMERICHOST); snprintf(logmsg, sizeof(logmsg), "Received no useable packet from %s!", addr_buf); + log_msg(logmsg, 1); if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp on_wire: Received no useable packet from %s!\n", addr_buf); - - log_msg(logmsg, 1); - return -1; } diff --git a/sntp/networking.c b/sntp/networking.c index 3b762c1e3..f79bff1d9 100644 --- a/sntp/networking.c +++ b/sntp/networking.c @@ -106,18 +106,20 @@ sendpkt ( int len ) { + int cc; + #ifdef DEBUG printf("sntp sendpkt: Packet data:\n"); pkt_output(pkt, len, stdout); #endif - if(ENABLED_OPT(NORMALVERBOSE)) { + if (ENABLED_OPT(NORMALVERBOSE)) { getnameinfo(&dest->sa, SOCKLEN(dest), adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST); printf("sntp sendpkt: Sending packet to %s... ", adr_buf); } - int cc = sendto(rsock, (char *)pkt, len, 0, &dest->sa, SOCKLEN(dest)); + cc = sendto(rsock, (void *)pkt, len, 0, &dest->sa, SOCKLEN(dest)); if (cc == SOCKET_ERROR) { #ifdef DEBUG @@ -127,11 +129,8 @@ sendpkt ( if (errno != EWOULDBLOCK && errno != ENOBUFS) { } - } - else { - if(ENABLED_OPT(NORMALVERBOSE)) - printf("Packet sent.\n"); - } + } else if (ENABLED_OPT(NORMALVERBOSE)) + printf("Packet sent.\n"); } /* Receive raw data */ @@ -465,10 +464,12 @@ recv_bcst_pkt ( } if (STRATUM_PKT_UNSPEC == rpkt->stratum) { + char *ref_char; + if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recv_bcst_pkt: Stratum unspecified, going to check for KOD (stratum: %i)\n", rpkt->stratum); - char *ref_char = (char *) &rpkt->refid; + ref_char = (char *) &rpkt->refid; /* If it's a KOD packet we'll just use the KOD information */ if (ref_char[0] != 'X') { @@ -512,13 +513,13 @@ recvpkt ( char *rdata /* , done */; register int a; - int has_mac, is_authentic, orig_pkt_len; + int has_mac, is_authentic, pkt_len, orig_pkt_len; /* Much space, just to be sure */ rdata = emalloc(sizeof(char) * 256); - int pkt_len = recvdata(rsock, &sender, rdata, 256); + pkt_len = recvdata(rsock, &sender, rdata, 256); #if 0 /* done uninitialized */ if (!done) { @@ -657,11 +658,13 @@ recvpkt ( /* Stratum is unspecified (0) check what's going on */ if (STRATUM_PKT_UNSPEC == rpkt->stratum) { + char *ref_char; + if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recvpkt: Stratum unspecified, going to check for KOD (stratum: %i)\n", rpkt->stratum); - char *ref_char = (char *) &rpkt->refid; + ref_char = (char *) &rpkt->refid; if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recvpkt: Packet refid: %c%c%c%c\n", ref_char[0], ref_char[1], ref_char[2], ref_char[3]);