(CID 159, apparent overrun due to union, actually correct).
bk: 4e30944fz4icyT7_qSiqtrhutRIChw
* [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
* Do not force "legacy" when --with-locfile is not given, genLocInfo
will find the correct default for the system.
+* Fix warnings in ntp_request.c ([Bug 1973] oversight) and sntp/main.c
+ (CID 159, apparent overrun due to union, actually correct).
(4.2.7p196) 2011/07/27 Released by Harlan Stenn <stenn@ntp.org>
* DEFAULT INSTALLATION DIRECTORY CHANGES ON SOME OSes: to get the old
behavior, pass --with-locfile=legacy to 'configure'
ip->flash = (u_char)pp->flash;
ip->flash2 = (u_short)pp->flash;
ip->estbdelay = HTONS_FP(DTOFP(pp->delay));
- ip->ttl = pp->ttl;
+ ip->ttl = (u_char)pp->ttl;
ip->associd = htons(pp->associd);
ip->rootdelay = HTONS_FP(DTOUFP(pp->rootdelay));
ip->rootdispersion = HTONS_FP(DTOUFP(pp->rootdisp));
}
/* Read in the packet */
- rpktl = recvdata(fd, &sender, &rbuf.pkt, sizeof(rbuf));
+ rpktl = recvdata(fd, &sender, &rbuf, sizeof(rbuf));
if (rpktl < 0) {
msyslog(LOG_DEBUG, "recvfrom error %m");
return;
recvdata(
SOCKET rsock,
sockaddr_u * sender,
- struct pkt * rdata,
+ void * rdata,
int rdata_length
)
{
int recvc;
slen = sizeof(*sender);
- recvc = recvfrom(rsock, (void *)rdata, rdata_length, 0,
+ recvc = recvfrom(rsock, rdata, rdata_length, 0,
&sender->sa, &slen);
if (recvc < 0)
return recvc;
#ifdef DEBUG
if (debug > 2) {
printf("Received %d bytes from %s:\n", recvc, sptoa(sender));
- pkt_output(rdata, recvc, stdout);
+ pkt_output((struct pkt *)rdata, recvc, stdout);
}
#endif
return recvc;
/* From ntpdate.c */
void sendpkt(SOCKET rsock, sockaddr_u *dest, struct pkt *pkt, int len);
-int recvdata(SOCKET rsock, sockaddr_u *sender, struct pkt *rdata,
+int recvdata(SOCKET rsock, sockaddr_u *sender, void *rdata,
int rdata_len);
int recvpkt(SOCKET rsock, struct pkt *rpkt, unsigned int rsize,
struct pkt *spkt);