+* [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
(4.2.5p227) 2009/10/05 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1135] :config fails with "Server disallowed request"
* [Bug 1330] disallow interface/nic rules when --novirtualips or
* Documentation updates from Dave Hart/Dave Mills.
(4.2.5p226) 2009/10/04 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1318] Allow multiple -g options on ntpd command line.
-* [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+* [Bug 1327] ntpq, ntpdc, ntp-keygen -d & -D should work with configure
--disable-debugging.
* Add ntpd --saveconfigquit <filename> option for future build-time
testing of saveconfig fidelity.
}
if (debug >= 3 && shouldbesize > n) {
- u_long key;
- u_long *lpkt;
+ u_int32 key;
+ u_int32 *lpkt;
int maclen;
/*
printf(
"Packet shows signs of authentication (total %d, data %d, mac %d)\n",
n, shouldbesize, maclen);
- lpkt = (u_long *)&rpkt;
+ lpkt = (u_int32 *)&rpkt;
printf("%08lx %08lx %08lx %08lx %08lx %08lx\n",
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long) - 3]),
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long) - 2]),
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long) - 1]),
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long)]),
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long) + 1]),
- (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_long) + 2]));
- key = ntohl(lpkt[(n - maclen) / sizeof(u_long)]);
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 3]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 2]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 1]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32)]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 1]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 2]));
+ key = ntohl(lpkt[(n - maclen) / sizeof(u_int32)]);
printf("Authenticated with keyid %lu\n", (u_long)key);
if (key != 0 && key != info_auth_keyid) {
printf("We don't know that key\n");
qpkt.offset = 0;
qpkt.count = htons((u_short)qsize);
+ pktsize = CTL_HEADER_LEN;
+
/*
- * If we have data, copy it in and pad it out to a 64
- * bit boundary.
+ * If we have data, copy and pad it out to a 32-bit boundary.
*/
if (qsize > 0) {
- memmove((char *)qpkt.data, qdata, (unsigned)qsize);
- pktsize = qsize + CTL_HEADER_LEN;
- while (pktsize & (sizeof(u_long) - 1)) {
+ memcpy(qpkt.data, qdata, (unsigned)qsize);
+ pktsize += qsize;
+ while (pktsize & (sizeof(u_int32) - 1)) {
qpkt.data[qsize++] = 0;
pktsize++;
}
- } else {
- pktsize = CTL_HEADER_LEN;
}
/*