p->query->msg.xmttime.int_part = arc4random(); p->query->msg.xmttime.fraction = arc4random();
p->query->msg.xmttime.int_partl = arc4random(); p->query->msg.xmttime.fractionl = arc4random();
client_query(struct ntp_peer *p){	int	tos = IPTOS_LOWDELAY;	if (p->addr == NULL && client_nextaddr(p) == -1) {		set_next(p, INTERVAL_QUERY_PATHETIC);		return (-1);	}	if (p->query->fd == -1) {		struct sockaddr *sa = (struct sockaddr *)&p->addr->ss;		if ((p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM,		    0)) == -1)			fatal("client_query socket");		if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) {			if (errno == ECONNREFUSED || errno == ENETUNREACH ||			    errno == EHOSTUNREACH) {				client_nextaddr(p);				set_next(p, INTERVAL_QUERY_PATHETIC);				return (-1);			} else				fatal("client_query connect");		}		if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query->fd,		    IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) == -1)			log_warn("setsockopt IPTOS_LOWDELAY");	}	/*	 * Send out a random 64-bit number as our transmit time.  The NTP	 * server will copy said number into the originate field on the	 * response that it sends us.  This is totally legal per the SNTP spec.	 *	 * The impact of this is two fold: we no longer send out the current	 * system time for the world to see (which may aid an attacker), and	 * it gives us a (not very secure) way of knowing that we're not	 * getting spoofed by an attacker that can't capture our traffic	 * but can spoof packets from the NTP server we're communicating with.	 *	 * Save the real transmit timestamp locally.	 */	p->query->msg.xmttime.int_part = arc4random();	p->query->msg.xmttime.fraction = arc4random();	p->query->xmttime = gettime();	if (ntp_sendmsg(p->query->fd, NULL, &p->query->msg,	    NTP_MSGSIZE_NOAUTH, 0) == -1) {		set_next(p, INTERVAL_QUERY_PATHETIC);		return (-1);	}	p->state = STATE_QUERY_SENT;	set_deadline(p, QUERYTIME_MAX);	return (0);}