]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c:
authorFrank Kardel <kardel@ntp.org>
Tue, 1 Aug 2006 18:03:38 +0000 (18:03 +0000)
committerFrank Kardel <kardel@ntp.org>
Tue, 1 Aug 2006 18:03:38 +0000 (18:03 +0000)
  Bug 678:
  make size of control message buffer configurable if
  needbe. use lower default of 1536 bytes as qnx couldn't
  cope with 5120 bytes and we are not really expecting
  long control messages.
  qnx limit is around 1900 bytes - qnx analysed by
  Michael Tatarinov - thanks

bk: 44cf977a8aFx815MaRu5cs3ZT5LnCA

ntpd/ntp_io.c

index c0ffb1fd8cfaa3ed28a6908363f9a09aeaf2e208..c7d9502a05f6c4336e83c21981efaa7830c0f0c3 100644 (file)
@@ -60,6 +60,9 @@ extern const char *specific_interface;
 #if defined(CMSG_FIRSTHDR)
 #define HAVE_TIMESTAMP
 #define USE_TIMESTAMP_CMSG
+#ifndef TIMESTAMP_CTLMSGBUF_SIZE
+#define TIMESTAMP_CTLMSGBUF_SIZE 1536 /* moderate default */
+#endif
 #else
 /* fill in for old/other timestamp interfaces */
 #endif
@@ -2706,7 +2709,7 @@ read_network_packet(SOCKET fd, struct interface *itf, l_fp ts)
 #ifdef HAVE_TIMESTAMP
        struct msghdr msghdr;
        struct iovec iovec;
-       char control[5120];     /* pick up control messages */
+       char control[TIMESTAMP_CTLMSGBUF_SIZE]; /* pick up control messages */
 #endif
 
        /*