From: Harlan Stenn Date: Thu, 16 Jul 2015 07:37:32 +0000 (+0000) Subject: Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn. X-Git-Tag: NTP_4_3_60~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ac7552aeffc1e121a9c58a0ebddbb5cdfc0da5;p=thirdparty%2Fntp.git Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn. bk: 55a75f3cJWq-3zG-yQRj6dTU_bvPDA --- diff --git a/ChangeLog b/ChangeLog index aec5887ec..a689abab6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,7 @@ * tests/libntp/test_caltontp needs -lpthread. Harlan Stenn. * br-flock: --enable-local-libevent. Harlan Stenn. * scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn. +* Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn. --- (4.2.8p3) 2015/06/29 Released by Harlan Stenn diff --git a/include/ntp_assert.h b/include/ntp_assert.h index 2f3bbc8a0..42d78acab 100644 --- a/include/ntp_assert.h +++ b/include/ntp_assert.h @@ -88,10 +88,6 @@ extern void calysto_assert(unsigned char cnd); /* check whether this holds */ * We initially used NTP_REQUIRE() instead of REQUIRE() etc, but that * is unneccesarily verbose, as libisc use of REQUIRE() etc shows. */ -#define NTP_REQUIRE(x) REQUIRE(x) -#define NTP_INSIST(x) INSIST(x) -#define NTP_INVARIANT(x) INVARIANT(x) -#define NTP_ENSURE(x) ENSURE(x) # ifdef DEBUG #define DEBUG_REQUIRE(x) REQUIRE(x) diff --git a/include/ntp_lists.h b/include/ntp_lists.h index 2b6e61696..d74197494 100644 --- a/include/ntp_lists.h +++ b/include/ntp_lists.h @@ -215,9 +215,9 @@ do { \ \ for (pentry = (listhead); \ pentry != NULL; \ - pentry = pentry->nextlink){ \ - NTP_INSIST(pentry != pentry->nextlink); \ - NTP_INSIST((listhead) != pentry->nextlink); \ + pentry = pentry->nextlink) { \ + INSIST(pentry != pentry->nextlink); \ + INSIST((listhead) != pentry->nextlink); \ } \ } while (FALSE) diff --git a/libntp/atolfp.c b/libntp/atolfp.c index 3a65f6bcb..9a2f69178 100644 --- a/libntp/atolfp.c +++ b/libntp/atolfp.c @@ -40,7 +40,7 @@ atolfp( int isneg; static const char *digits = "0123456789"; - NTP_REQUIRE(str != NULL); + REQUIRE(str != NULL); isneg = 0; dec_i = dec_f = 0; diff --git a/libntp/caljulian.c b/libntp/caljulian.c index 6463699b1..4a306033a 100644 --- a/libntp/caljulian.c +++ b/libntp/caljulian.c @@ -28,7 +28,7 @@ caljulian( ntpcal_split split; - NTP_INSIST(NULL != jt); + INSIST(NULL != jt); /* * Unfold ntp time around current time into NTP domain. Split diff --git a/libntp/caltontp.c b/libntp/caltontp.c index 4246a6a54..808c94c64 100644 --- a/libntp/caltontp.c +++ b/libntp/caltontp.c @@ -40,14 +40,14 @@ caltontp( int32_t eraday; /* CE Rata Die number */ vint64 ntptime;/* resulting NTP time */ - NTP_INSIST(jt != NULL); + REQUIRE(jt != NULL); - NTP_REQUIRE(jt->month <= 13); /* permit month 0..13! */ - NTP_REQUIRE(jt->monthday <= 32); - NTP_REQUIRE(jt->yearday <= 366); - NTP_REQUIRE(jt->hour <= 24); - NTP_REQUIRE(jt->minute <= MINSPERHR); - NTP_REQUIRE(jt->second <= SECSPERMIN); + REQUIRE(jt->month <= 13); /* permit month 0..13! */ + REQUIRE(jt->monthday <= 32); + REQUIRE(jt->yearday <= 366); + REQUIRE(jt->hour <= 24); + REQUIRE(jt->minute <= MINSPERHR); + REQUIRE(jt->second <= SECSPERMIN); /* * First convert the date to he corresponding RataDie diff --git a/libntp/decodenetnum.c b/libntp/decodenetnum.c index 187d5cae7..ebcb2da69 100644 --- a/libntp/decodenetnum.c +++ b/libntp/decodenetnum.c @@ -35,8 +35,8 @@ decodenetnum( char *np; char name[80]; - NTP_REQUIRE(num != NULL); - NTP_REQUIRE(strlen(num) < sizeof(name)); + REQUIRE(num != NULL); + REQUIRE(strlen(num) < sizeof(name)); port_str = NULL; if ('[' != num[0]) { @@ -72,7 +72,7 @@ decodenetnum( err = getaddrinfo(cp, "ntp", &hints, &ai); if (err != 0) return 0; - NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum)); + INSIST(ai->ai_addrlen <= sizeof(*netnum)); ZERO(*netnum); memcpy(netnum, ai->ai_addr, ai->ai_addrlen); freeaddrinfo(ai); diff --git a/libntp/msyslog.c b/libntp/msyslog.c index 283414d74..4e0aee5db 100644 --- a/libntp/msyslog.c +++ b/libntp/msyslog.c @@ -454,7 +454,7 @@ change_logfile( size_t octets; #endif /* POSIX */ - NTP_REQUIRE(fname != NULL); + REQUIRE(fname != NULL); log_fname = fname; /* diff --git a/libntp/ntp_intres.c b/libntp/ntp_intres.c index eea88a127..b0f562036 100644 --- a/libntp/ntp_intres.c +++ b/libntp/ntp_intres.c @@ -249,12 +249,12 @@ getaddrinfo_sometime( size_t servsize; time_t now; - NTP_REQUIRE(NULL != node); + REQUIRE(NULL != node); if (NULL != hints) { - NTP_REQUIRE(0 == hints->ai_addrlen); - NTP_REQUIRE(NULL == hints->ai_addr); - NTP_REQUIRE(NULL == hints->ai_canonname); - NTP_REQUIRE(NULL == hints->ai_next); + REQUIRE(0 == hints->ai_addrlen); + REQUIRE(NULL == hints->ai_addr); + REQUIRE(NULL == hints->ai_canonname); + REQUIRE(NULL == hints->ai_next); } idx = get_dnschild_ctx(); @@ -420,7 +420,7 @@ blocking_getaddrinfo( ai = ai_res; while (NULL != ai) { - NTP_INSIST(ai->ai_addrlen <= sizeof(sockaddr_u)); + INSIST(ai->ai_addrlen <= sizeof(sockaddr_u)); memcpy(cp, ai->ai_addr, ai->ai_addrlen); cp += sizeof(sockaddr_u); @@ -568,7 +568,7 @@ getaddrinfo_sometime_complete( ai[i].ai_canonname += (size_t)canon_start; } - NTP_ENSURE((char *)psau == canon_start); + ENSURE((char *)psau == canon_start); if (!gai_resp->ai_count) ai = NULL; @@ -634,8 +634,8 @@ getnameinfo_sometime( dnschild_ctx * child_ctx; time_t time_now; - NTP_REQUIRE(hostoctets); - NTP_REQUIRE(hostoctets + servoctets < 1024); + REQUIRE(hostoctets); + REQUIRE(hostoctets + servoctets < 1024); idx = get_dnschild_ctx(); child_ctx = dnschild_contexts[idx]; @@ -699,7 +699,7 @@ blocking_getnameinfo( * large allocations. We only need room for the host * and service names. */ - NTP_REQUIRE(octets < sizeof(host)); + REQUIRE(octets < sizeof(host)); service = host + gni_req->hostoctets; worker_ctx = get_worker_context(c, gni_req->dns_idx); @@ -775,8 +775,8 @@ blocking_getnameinfo( cp += gni_resp->servoctets; } - NTP_INSIST((size_t)(cp - (char *)resp) == resp_octets); - NTP_INSIST(resp_octets - sizeof(*resp) == gni_resp->octets); + INSIST((size_t)(cp - (char *)resp) == resp_octets); + INSIST(resp_octets - sizeof(*resp) == gni_resp->octets); rc = queue_blocking_response(c, resp, resp_octets, req); if (rc) diff --git a/libntp/ntp_rfc2553.c b/libntp/ntp_rfc2553.c index f267999c5..a9ebb4b35 100644 --- a/libntp/ntp_rfc2553.c +++ b/libntp/ntp_rfc2553.c @@ -221,7 +221,7 @@ copy_addrinfo_common( } ++ai_cpy; } - NTP_ENSURE(pcanon == ((char *)dst + octets)); + ENSURE(pcanon == ((char *)dst + octets)); return dst; } diff --git a/libntp/prettydate.c b/libntp/prettydate.c index 5da5ecc50..25b085ef2 100644 --- a/libntp/prettydate.c +++ b/libntp/prettydate.c @@ -141,7 +141,7 @@ get_struct_tm( return NULL; /* That's truly pathological! */ /* 'tm' surely not NULL here! */ - NTP_INSIST(tm != NULL); + INSIST(tm != NULL); if (folds != 0) { tm->tm_year += folds * SOLAR_CYCLE_YEARS; if (tm->tm_year <= 0 || tm->tm_year >= 200) diff --git a/libntp/recvbuff.c b/libntp/recvbuff.c index 83a9ee193..73ebe886d 100644 --- a/libntp/recvbuff.c +++ b/libntp/recvbuff.c @@ -216,7 +216,7 @@ get_free_recv_buffer_alloc(void) create_buffers(RECV_INC); buffer = get_free_recv_buffer(); } - NTP_ENSURE(buffer != NULL); + ENSURE(buffer != NULL); return (buffer); } #endif diff --git a/libntp/socket.c b/libntp/socket.c index de678c634..11fb00469 100644 --- a/libntp/socket.c +++ b/libntp/socket.c @@ -78,7 +78,7 @@ move_fd( static SOCKET socket_boundary = -1; SOCKET newfd; - NTP_REQUIRE((int)fd >= 0); + REQUIRE((int)fd >= 0); /* * check whether boundary has be set up @@ -115,7 +115,7 @@ move_fd( socket_boundary)); } while (socket_boundary > 0); #else - NTP_REQUIRE((int)fd >= 0); + ENSURE((int)fd >= 0); #endif /* !defined(SYS_WINNT) && defined(F_DUPFD) */ return fd; } diff --git a/libntp/socktohost.c b/libntp/socktohost.c index c61e57148..3d9ab960e 100644 --- a/libntp/socktohost.c +++ b/libntp/socktohost.c @@ -79,7 +79,7 @@ socktohost( if (a_info) goto forward_fail; - NTP_INSIST(alist != NULL); + INSIST(alist != NULL); for (ai = alist; ai != NULL; ai = ai->ai_next) { /* diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 300773240..0ea5d455d 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -1152,9 +1152,8 @@ create_address_node( { address_node *my_node; - NTP_REQUIRE(NULL != addr); - NTP_REQUIRE(AF_INET == type || - AF_INET6 == type || AF_UNSPEC == type); + REQUIRE(NULL != addr); + REQUIRE(AF_INET == type || AF_INET6 == type || AF_UNSPEC == type); my_node = emalloc_zero(sizeof(*my_node)); my_node->address = addr; my_node->type = (u_short)type; @@ -1170,7 +1169,7 @@ destroy_address_node( { if (NULL == my_node) return; - NTP_REQUIRE(NULL != my_node->address); + REQUIRE(NULL != my_node->address); free(my_node->address); free(my_node); @@ -1567,7 +1566,7 @@ create_nic_rule_node( { nic_rule_node *my_node; - NTP_REQUIRE(match_class != 0 || if_name != NULL); + REQUIRE(match_class != 0 || if_name != NULL); my_node = emalloc_zero(sizeof(*my_node)); my_node->match_class = match_class; @@ -4880,9 +4879,9 @@ getnetnum( enum gnn_type a_type /* ignored */ ) { - NTP_REQUIRE(AF_UNSPEC == AF(addr) || - AF_INET == AF(addr) || - AF_INET6 == AF(addr)); + REQUIRE(AF_UNSPEC == AF(addr) || + AF_INET == AF(addr) || + AF_INET6 == AF(addr)); if (!is_ip_address(num, AF(addr), addr)) return 0; diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index dac4ca80f..2ed209bdf 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -1401,7 +1401,7 @@ ctl_putstr( memcpy(buffer, tag, tl); cp = buffer + tl; if (len > 0) { - NTP_INSIST(tl + 3 + len <= sizeof(buffer)); + INSIST(tl + 3 + len <= sizeof(buffer)); *cp++ = '='; *cp++ = '"'; memcpy(cp, data, len); @@ -1436,7 +1436,7 @@ ctl_putunqstr( memcpy(buffer, tag, tl); cp = buffer + tl; if (len > 0) { - NTP_INSIST(tl + 1 + len <= sizeof(buffer)); + INSIST(tl + 1 + len <= sizeof(buffer)); *cp++ = '='; memcpy(cp, data, len); cp += len; @@ -1465,7 +1465,7 @@ ctl_putdblf( while (*cq != '\0') *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer)); + INSIST((size_t)(cp - buffer) < sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), use_f ? "%.*f" : "%.*g", precision, d); cp += strlen(cp); @@ -1491,7 +1491,7 @@ ctl_putuint( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval); cp += strlen(cp); ctl_putdata(buffer, (unsigned)( cp - buffer ), 0); @@ -1518,7 +1518,7 @@ ctl_putcal( pcal->hour, pcal->minute ); - NTP_INSIST(numch < sizeof(buffer)); + INSIST(numch < sizeof(buffer)); ctl_putdata(buffer, numch, 0); return; @@ -1549,7 +1549,7 @@ ctl_putfs( tm = gmtime(&fstamp); if (NULL == tm) return; - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%04d%02d%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); @@ -1578,7 +1578,7 @@ ctl_puthex( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval); cp += strlen(cp); ctl_putdata(buffer,(unsigned)( cp - buffer ), 0); @@ -1604,7 +1604,7 @@ ctl_putint( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival); cp += strlen(cp); ctl_putdata(buffer, (unsigned)( cp - buffer ), 0); @@ -1630,7 +1630,7 @@ ctl_putts( *cp++ = *cq++; *cp++ = '='; - NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer)); + INSIST((size_t)(cp - buffer) < sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08x.%08x", (u_int)ts->l_ui, (u_int)ts->l_uf); cp += strlen(cp); @@ -1662,7 +1662,7 @@ ctl_putadr( cq = numtoa(addr32); else cq = stoa(addr); - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq); cp += strlen(cp); ctl_putdata(buffer, (unsigned)(cp - buffer), 0); @@ -1733,7 +1733,7 @@ ctl_putarray( if (i == 0) i = NTP_SHIFT; i--; - NTP_INSIST((cp - buffer) < (int)sizeof(buffer)); + INSIST((cp - buffer) < (int)sizeof(buffer)); snprintf(cp, sizeof(buffer) - (cp - buffer), " %.2f", arr[i] * 1e3); cp += strlen(cp); @@ -3110,7 +3110,7 @@ read_peervars(void) ctl_error(CERR_UNKNOWNVAR); return; } - NTP_INSIST(v->code < COUNTOF(wants)); + INSIST(v->code < COUNTOF(wants)); wants[v->code] = 1; gotvar = 1; } @@ -3153,19 +3153,19 @@ read_sysvars(void) gotvar = 0; while (NULL != (v = ctl_getitem(sys_var, &valuep))) { if (!(EOV & v->flags)) { - NTP_INSIST(v->code < wants_count); + INSIST(v->code < wants_count); wants[v->code] = 1; gotvar = 1; } else { v = ctl_getitem(ext_sys_var, &valuep); - NTP_INSIST(v != NULL); + INSIST(v != NULL); if (EOV & v->flags) { ctl_error(CERR_UNKNOWNVAR); free(wants); return; } n = v->code + CS_MAXCODE + 1; - NTP_INSIST(n < wants_count); + INSIST(n < wants_count); wants[n] = 1; gotvar = 1; } @@ -4399,7 +4399,7 @@ read_clockstatus( gotvar = TRUE; } else { v = ctl_getitem(kv, &valuep); - NTP_INSIST(NULL != v); + INSIST(NULL != v); if (EOV & v->flags) { ctl_error(CERR_UNKNOWNVAR); free(wants); @@ -4795,7 +4795,7 @@ report_event( for (i = 1; i <= CS_VARLIST; i++) ctl_putsys(i); } else { - NTP_INSIST(peer != NULL); + INSIST(peer != NULL); rpkt.associd = htons(peer->associd); rpkt.status = htons(ctlpeerstatus(peer)); @@ -4900,7 +4900,7 @@ count_var( while (!(EOV & (k++)->flags)) c++; - NTP_ENSURE(c <= USHRT_MAX); + ENSURE(c <= USHRT_MAX); return (u_short)c; } diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 45b2cdd00..cd767cc15 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -380,7 +380,7 @@ make_keylist( EVP_SignUpdate(&ctx, (u_char *)vp, 12); EVP_SignUpdate(&ctx, vp->ptr, sizeof(struct autokey)); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); peer->flags |= FLAG_ASSOC; } @@ -1591,7 +1591,7 @@ crypto_encrypt( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, vallen); if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) { - NTP_INSIST(vallen <= sign_siglen); + INSIST(vallen <= sign_siglen); vp->siglen = htonl(vallen); } return (XEVNT_OK); @@ -1825,7 +1825,7 @@ crypto_update(void) EVP_SignUpdate(&ctx, (u_char *)&pubkey, 12); EVP_SignUpdate(&ctx, pubkey.ptr, ntohl(pubkey.vallen)); if (EVP_SignFinal(&ctx, pubkey.sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); pubkey.siglen = htonl(len); } } @@ -1846,7 +1846,7 @@ crypto_update(void) EVP_SignUpdate(&ctx, cp->cert.ptr, ntohl(cp->cert.vallen)); if (EVP_SignFinal(&ctx, cp->cert.sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); cp->cert.siglen = htonl(len); } } @@ -1896,7 +1896,7 @@ crypto_update(void) EVP_SignUpdate(&ctx, (u_char *)&tai_leap, 12); EVP_SignUpdate(&ctx, tai_leap.ptr, len); if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); tai_leap.siglen = htonl(len); } crypto_flags |= CRYPTO_FLAG_TAI; @@ -1997,9 +1997,9 @@ asn_to_calendar ( * 100. Dontcha love ASN.1? Better than MIL-188. */ len = asn1time->length; - NTP_REQUIRE(len < sizeof(v)); + REQUIRE(len < sizeof(v)); (void)strncpy(v, (char *)(asn1time->data), len); - NTP_REQUIRE(len >= 13); + REQUIRE(len >= 13); temp = strtoul(v+len-3, NULL, 10); pjd->second = temp; v[len-3] = '\0'; @@ -2169,7 +2169,7 @@ crypto_alice( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } return (XEVNT_OK); @@ -2279,7 +2279,7 @@ crypto_bob( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, vallen); if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) { - NTP_INSIST(vallen <= sign_siglen); + INSIST(vallen <= sign_siglen); vp->siglen = htonl(vallen); } return (XEVNT_OK); @@ -2486,7 +2486,7 @@ crypto_alice2( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } return (XEVNT_OK); @@ -2586,7 +2586,7 @@ crypto_bob2( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } return (XEVNT_OK); @@ -2817,7 +2817,7 @@ crypto_alice3( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } return (XEVNT_OK); @@ -2919,7 +2919,7 @@ crypto_bob3( EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } return (XEVNT_OK); @@ -3158,7 +3158,7 @@ cert_sign( EVP_SignUpdate(&ctx, (u_char *)vp, 12); EVP_SignUpdate(&ctx, vp->ptr, len); if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) { - NTP_INSIST(len <= sign_siglen); + INSIST(len <= sign_siglen); vp->siglen = htonl(len); } } diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index a93733f82..136e9e9d4 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -371,7 +371,7 @@ maintain_activefds( maxactivefd = i; break; } - NTP_INSIST(fd != maxactivefd); + INSIST(fd != maxactivefd); } } } @@ -687,8 +687,8 @@ addr_samesubnet( const u_int32 * pm; size_t loops; - NTP_REQUIRE(AF(a) == AF(a_mask)); - NTP_REQUIRE(AF(b) == AF(b_mask)); + REQUIRE(AF(a) == AF(a_mask)); + REQUIRE(AF(b) == AF(b_mask)); /* * With address and mask families verified to match, comparing * the masks also validates the address's families match. @@ -735,8 +735,8 @@ is_ip_address( char tmpbuf[128]; char *pch; - NTP_REQUIRE(host != NULL); - NTP_REQUIRE(addr != NULL); + REQUIRE(host != NULL); + REQUIRE(addr != NULL); ZERO_SOCK(addr); @@ -1250,15 +1250,15 @@ add_nic_rule( rule->action = action; if (MATCH_IFNAME == match_type) { - NTP_REQUIRE(NULL != if_name); + REQUIRE(NULL != if_name); rule->if_name = estrdup(if_name); } else if (MATCH_IFADDR == match_type) { - NTP_REQUIRE(NULL != if_name); + REQUIRE(NULL != if_name); /* set rule->addr */ is_ip = is_ip_address(if_name, AF_UNSPEC, &rule->addr); - NTP_REQUIRE(is_ip); + REQUIRE(is_ip); } else - NTP_REQUIRE(NULL == if_name); + REQUIRE(NULL == if_name); LINK_SLIST(nic_rule_list, rule, next); } @@ -1278,7 +1278,7 @@ action_text( t = "ERROR"; /* quiet uninit warning */ DPRINTF(1, ("fatal: unknown nic_rule_action %d\n", action)); - NTP_ENSURE(0); + ENSURE(0); break; case ACTION_LISTEN: @@ -2397,7 +2397,7 @@ enable_multicast_if( u_int off6 = 0; #endif - NTP_REQUIRE(AF(maddr) == AF(&iface->sin)); + REQUIRE(AF(maddr) == AF(&iface->sin)); switch (AF(&iface->sin)) { @@ -2629,7 +2629,7 @@ io_setbclient(void) continue; /* Only IPv4 addresses are valid for broadcast */ - NTP_REQUIRE(IS_IPV4(&interf->sin)); + REQUIRE(IS_IPV4(&interf->sin)); /* Do we already have the broadcast address open? */ if (interf->flags & INT_BCASTOPEN) { @@ -4079,7 +4079,7 @@ calc_addr_distance( int a1_greater; int i; - NTP_REQUIRE(AF(a1) == AF(a2)); + REQUIRE(AF(a1) == AF(a2)); ZERO_SOCK(dist); AF(dist) = AF(a1); @@ -4130,7 +4130,7 @@ cmp_addr_distance( { int i; - NTP_REQUIRE(AF(d1) == AF(d2)); + REQUIRE(AF(d1) == AF(d2)); if (IS_IPV4(d1)) { if (SRCADR(d1) < SRCADR(d2)) diff --git a/ntpd/ntp_monitor.c b/ntpd/ntp_monitor.c index 02fd75730..44676b2b6 100644 --- a/ntpd/ntp_monitor.c +++ b/ntpd/ntp_monitor.c @@ -133,7 +133,7 @@ remove_from_hash( hash = MON_HASH(&mon->rmtadr); UNLINK_SLIST(punlinked, mon_hash[hash], mon, hash_next, mon_entry); - NTP_ENSURE(punlinked == mon); + ENSURE(punlinked == mon); } diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index d42d804d4..41dbae561 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -764,7 +764,7 @@ newpeer( /* * For now only pool associations have a hostname. */ - NTP_INSIST(NULL == hostname || (MDF_POOL & cast_flags)); + INSIST(NULL == hostname || (MDF_POOL & cast_flags)); /* * First search from the beginning for an association with given diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index f0e9b9ec3..1f16ca797 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -1049,7 +1049,7 @@ refclock_control( if (NULL == peer) return; - NTP_INSIST(peer->procptr != NULL); + INSIST(peer->procptr != NULL); pp = peer->procptr; /* diff --git a/ntpd/ntp_restrict.c b/ntpd/ntp_restrict.c index 9948d54d9..dee705e88 100644 --- a/ntpd/ntp_restrict.c +++ b/ntpd/ntp_restrict.c @@ -173,7 +173,7 @@ alloc_res4(void) LINK_SLIST(resfree4, res, link); res = (void *)((char *)res - cb); } - NTP_INSIST(rl == res); + INSIST(rl == res); /* allocate the first */ return res; } @@ -199,7 +199,7 @@ alloc_res6(void) LINK_SLIST(resfree6, res, link); res = (void *)((char *)res - cb); } - NTP_INSIST(rl == res); + INSIST(rl == res); /* allocate the first */ return res; } @@ -223,7 +223,7 @@ free_res( else plisthead = &restrictlist4; UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u); - NTP_INSIST(unlinked == res); + INSIST(unlinked == res); if (v6) { zero_mem(res, V6_SIZEOF_RESTRICT_U); @@ -291,7 +291,7 @@ match_restrict6_addr( for (res = restrictlist6; res != NULL; res = next) { next = res->link; - NTP_INSIST(next != res); + INSIST(next != res); if (res->expire && res->expire <= current_time) free_res(res, v6); @@ -494,8 +494,8 @@ hack_restrict( op, stoa(resaddr), stoa(resmask), mflags, flags)); if (NULL == resaddr) { - NTP_REQUIRE(NULL == resmask); - NTP_REQUIRE(RESTRICT_FLAGS == op); + REQUIRE(NULL == resmask); + REQUIRE(RESTRICT_FLAGS == op); restrict_source_flags = flags; restrict_source_mflags = mflags; restrict_source_enabled = 1; @@ -528,7 +528,7 @@ hack_restrict( &match.u.v6.mask); } else /* not IPv4 nor IPv6 */ - NTP_REQUIRE(0); + REQUIRE(0); match.flags = flags; match.mflags = mflags; @@ -600,7 +600,7 @@ hack_restrict( break; default: /* unknown op */ - NTP_INSIST(0); + INSIST(0); break; } @@ -626,7 +626,7 @@ restrict_source( IS_MCAST(addr) || ISREFCLOCKADR(addr)) return; - NTP_REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr)); + REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr)); SET_HOSTMASK(&onesmask, AF(addr)); if (farewell) { diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index ce35bd4e2..8c07dac97 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -1443,7 +1443,7 @@ getnetnum( LENHOSTNAME, NULL, 0, 0); return 1; } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) { - NTP_INSIST(sizeof(*num) >= ai->ai_addrlen); + INSIST(sizeof(*num) >= ai->ai_addrlen); memcpy(num, ai->ai_addr, ai->ai_addrlen); if (fullhost != NULL) { if (ai->ai_canonname != NULL) diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index c6478701e..bfa5d2341 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -2387,7 +2387,7 @@ add_mru( } UNLINK_DLIST(mon, mlink); UNLINK_SLIST(unlinked, hash_table[hash], mon, hlink, mru); - NTP_INSIST(unlinked == mon); + INSIST(unlinked == mon); mru_dupes++; TRACE(2, ("(updated from %08x.%08x) ", mon->last.l_ui, mon->last.l_uf)); @@ -2482,7 +2482,7 @@ collect_mru_list( mru_count = 0; INIT_DLIST(mru_list, mlink); cb = NTP_HASH_SIZE * sizeof(*hash_table); - NTP_INSIST(NULL == hash_table); + INSIST(NULL == hash_table); hash_table = emalloc_zero(cb); c_mru_l_rc = FALSE; @@ -2526,7 +2526,7 @@ collect_mru_list( ri); while (ri--) { recent = HEAD_DLIST(mru_list, mlink); - NTP_INSIST(recent != NULL); + INSIST(recent != NULL); if (debug) fprintf(stderr, "tossing prior entry %s to resync\n", @@ -2535,7 +2535,7 @@ collect_mru_list( hash = NTP_HASH_ADDR(&recent->addr); UNLINK_SLIST(unlinked, hash_table[hash], recent, hlink, mru); - NTP_INSIST(unlinked == recent); + INSIST(unlinked == recent); free(recent); mru_count--; } @@ -2777,7 +2777,7 @@ collect_mru_list( if (have_now) list_complete = TRUE; if (list_complete) { - NTP_INSIST(0 == ri || have_addr_older); + INSIST(0 == ri || have_addr_older); } if (mrulist_interrupted) { printf("mrulist retrieval interrupted by operator.\n" @@ -3145,13 +3145,13 @@ mrulist( ppentry = sorted; if (MRUSORT_R_DEF != order) { ITER_DLIST_BEGIN(mru_list, recent, mlink, mru) - NTP_INSIST(ppentry < sorted + mru_count); + INSIST(ppentry < sorted + mru_count); *ppentry = recent; ppentry++; ITER_DLIST_END() } else { REV_ITER_DLIST_BEGIN(mru_list, recent, mlink, mru) - NTP_INSIST(ppentry < sorted + mru_count); + INSIST(ppentry < sorted + mru_count); *ppentry = recent; ppentry++; REV_ITER_DLIST_END() diff --git a/ports/winnt/libntp/termios.c b/ports/winnt/libntp/termios.c index 5ac017dcd..4ee89899b 100644 --- a/ports/winnt/libntp/termios.c +++ b/ports/winnt/libntp/termios.c @@ -94,7 +94,7 @@ HANDLE common_serial_open( } if (NULL == hnds[unit].h) { - NTP_ENSURE(0 == hnds[unit].opens); + INSIST(0 == hnds[unit].opens); LIB_GETBUF(windev); snprintf(windev, LIB_BUFLENGTH, "\\\\.\\COM%d", unit); TRACE(1, ("windows device %s\n", windev)); diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index dc2f150b7..fdb3c475f 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -410,7 +410,7 @@ is_qpc_built_on_pcc(void) FT_ULL ft4; FT_ULL ft5; - NTP_REQUIRE(NomPerfCtrFreq != 0); + REQUIRE(NomPerfCtrFreq != 0); QueryPerformanceCounter(&ft1.li); ft2.ull = get_pcc(); diff --git a/ports/winnt/ntpd/ntp_iocompletionport.c b/ports/winnt/ntpd/ntp_iocompletionport.c index 046d6cda1..621852af0 100644 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@ -610,7 +610,7 @@ ntpd_addremove_semaphore( * room, then append to the table array. */ if (hi >= ActiveWaitHandles) { - NTP_INSIST(ActiveWaitHandles < COUNTOF(WaitHandles)); + INSIST(ActiveWaitHandles < COUNTOF(WaitHandles)); WaitHandles[ActiveWaitHandles] = sem; ActiveWaitHandles++; } @@ -758,7 +758,7 @@ OnSerialWaitComplete( buff = lpo->recv_buf; dev = lpo->devCtx; - NTP_INSIST(rio == lpo->rio); + INSIST(rio == lpo->rio); #ifdef DEBUG if (~(EV_RXFLAG | EV_RLSD | EV_RXCHAR) & lpo->com_events) { @@ -898,7 +898,7 @@ OnSerialReadComplete( /* get & validate context and buffer. */ rio = lpo->rio; buff = lpo->recv_buf; - NTP_INSIST((ULONG_PTR)rio == key); + INSIST((ULONG_PTR)rio == key); /* Offload to worker pool */ if (!QueueUserWorkItem(&OnSerialReadWorker, lpo, WT_EXECUTEDEFAULT)) { @@ -1074,7 +1074,7 @@ OnRawSerialReadComplete( /* get & validate context and buffer. */ rio = lpo->rio; buff = lpo->recv_buf; - NTP_INSIST((ULONG_PTR)rio == key); + INSIST((ULONG_PTR)rio == key); /* ignore 0 bytes read. */ if (lpo->byteCount > 0) { @@ -1395,8 +1395,8 @@ OnSocketRecv( recvbuf_t * newbuff; struct interface * inter = (struct interface *)key; - NTP_REQUIRE(NULL != lpo); - NTP_REQUIRE(NULL != lpo->recv_buf); + REQUIRE(NULL != lpo); + REQUIRE(NULL != lpo->recv_buf); /* check and bail out if operation failed */ if (!IoResultCheck(lpo->errCode, lpo, @@ -1432,8 +1432,7 @@ OnSocketRecv( * If we keep it add some info to the structure */ if (buff->recv_length && !inter->ignore_packets) { - NTP_INSIST(buff->recv_srcadr_len <= - sizeof(buff->recv_srcadr)); + INSIST(buff->recv_srcadr_len <= sizeof(buff->recv_srcadr)); buff->receiver = &receive; buff->dstadr = inter; packets_received++;