ntp: use NTP instead of echo for presend

Switch to NTP for presend as the echo service (RFC 862) is rarely
enabled. When presend is active, send an NTP client packet to the
server/peer and ignore the reply.

This also fixes presend with separate client sockets. The destination
port can't be changed on connected sockets, so the echo packet was sent
to the NTP port instead of the echo port.
This commit is contained in:
Miroslav Lichvar
2014-08-15 15:45:48 +02:00
parent ff4abc69c3
commit cd5105b1db
4 changed files with 18 additions and 32 deletions

View File

@@ -56,7 +56,4 @@ extern void NIO_SendNormalPacket(NTP_Packet *packet, NTP_Remote_Address *remote_
/* Function to transmit an authenticated packet */
extern void NIO_SendAuthenticatedPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr, NTP_Local_Address *local_addr, int auth_len);
/* Function to send a datagram to a remote machine's UDP echo port. */
extern void NIO_SendEcho(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_addr);
#endif /* GOT_NTP_IO_H */