socket: increase message buffer length
Add extra space to the socket message buffer to be able to receive maximum-length NTP-over-PTP SW/HW-timestamped messages from the Linux error queue (which are looped back as layer-2 frames).
This commit is contained in:
parent
952c3b2528
commit
a2d1569455
1 changed files with 10 additions and 5 deletions
5
socket.c
5
socket.c
|
@ -59,11 +59,16 @@ struct Message {
|
||||||
union sockaddr_all name;
|
union sockaddr_all name;
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
/* Buffer of sufficient length for all expected messages */
|
/* Buffer of sufficient length for all expected messages */
|
||||||
|
struct {
|
||||||
|
/* Extra space for Ethernet, IPv4/IPv6, and UDP headers in
|
||||||
|
timestamped messages received from the Linux error queue */
|
||||||
|
uint8_t l234_headers[64];
|
||||||
union {
|
union {
|
||||||
NTP_Packet ntp_msg;
|
NTP_Packet ntp_msg;
|
||||||
PTP_NtpMessage ptp_msg;
|
PTP_NtpMessage ptp_msg;
|
||||||
CMD_Request cmd_request;
|
CMD_Request cmd_request;
|
||||||
CMD_Reply cmd_reply;
|
CMD_Reply cmd_reply;
|
||||||
|
} msg;
|
||||||
} msg_buf;
|
} msg_buf;
|
||||||
/* Aligned buffer for control messages */
|
/* Aligned buffer for control messages */
|
||||||
struct cmsghdr cmsg_buf[CMSG_BUF_SIZE / sizeof (struct cmsghdr)];
|
struct cmsghdr cmsg_buf[CMSG_BUF_SIZE / sizeof (struct cmsghdr)];
|
||||||
|
|
Loading…
Reference in a new issue