ntp: add support for processing of transmitted packets

Add new functions for processing of packets after they are actually
sent by the kernel or HW in order to get a more accurate transmit
timestamp. Rename old functions for processing of received packets and
their parameters to make the naming more consistent.
This commit is contained in:
Miroslav Lichvar
2016-10-07 14:08:07 +02:00
parent a8c6bea2d5
commit 8f6a1b5318
7 changed files with 150 additions and 42 deletions

View File

@@ -193,7 +193,7 @@ process_response(SignInstance *inst)
/* Send the signed NTP packet */
NIO_SendPacket(&inst->response.signed_packet, &inst->remote_addr, &inst->local_addr,
ntohl(inst->response.length) + sizeof (inst->response.length) -
offsetof(SigndResponse, signed_packet));
offsetof(SigndResponse, signed_packet), 0);
/* Update exponential moving average of the authentication delay */
delay = CLAMP(MIN_AUTH_DELAY, delay, MAX_AUTH_DELAY);