udp: work around phyter quirk.
The phyter offers one step sync transmission, but it alters the UDP checksum by changing the last two bytes, after the PTP payload. While this is only standardized for IPv6, we will go with it for IPv4 as well, since the phyter is the only hardware out there. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
b96e73994b
commit
ae41fa0f68
8
udp.c
8
udp.c
|
@ -190,6 +190,14 @@ static int udp_send(struct transport *t, struct fdarray *fda, int event, int pee
|
|||
addr.sin_addr = peer ? mcast_addr[MC_PDELAY] : mcast_addr[MC_PRIMARY];
|
||||
addr.sin_port = htons(event ? EVENT_PORT : GENERAL_PORT);
|
||||
|
||||
/*
|
||||
* Extend the payload by two, for UDP checksum correction.
|
||||
* This is not really part of the standard, but it is the way
|
||||
* that the phyter works.
|
||||
*/
|
||||
if (event == TRANS_ONESTEP)
|
||||
len += 2;
|
||||
|
||||
cnt = sendto(fd, buf, len, 0, (struct sockaddr *)&addr, sizeof(addr));
|
||||
if (cnt < 1) {
|
||||
pr_err("sendto failed: %m");
|
||||
|
|
Loading…
Reference in New Issue