[Git][NTPsec/ntpsec][master] 2 commits: u_short -> uint16_t in the ntp_control structure.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Jul 11 17:07:47 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
87a7aae4 by Eric S. Raymond at 2016-07-11T12:55:34-04:00
u_short -> uint16_t in the ntp_control structure.

We need to use only POSIX fixed-length types in any struct that will
be shipped as a packet.  Elininate unsafe types inhis structure.

- - - - -
caa15346 by Eric S. Raymond at 2016-07-11T13:03:44-04:00
Remove dead code.  This was only needed on very old HP/UXes.

- - - - -


2 changed files:

- include/ntp_control.h
- ntpq/ntpq.c


Changes:

=====================================
include/ntp_control.h
=====================================
--- a/include/ntp_control.h
+++ b/include/ntp_control.h
@@ -12,11 +12,11 @@ typedef union ctl_pkt_u_tag {
 struct ntp_control {
 	uint8_t li_vn_mode;		/* leap, version, mode */
 	uint8_t r_m_e_op;		/* response, more, error, opcode */
-	u_short sequence;		/* sequence number of request */
-	u_short status;			/* status word for association */
-	associd_t associd;		/* association ID */
-	u_short offset;			/* offset of this batch of data */
-	u_short count;			/* count of data in this packet */
+	uint16_t sequence;		/* sequence number of request */
+	uint16_t status;		/* status word for association */
+	uint16_t associd;		/* association ID (associd_t) */
+	uint16_t offset;		/* offset of this batch of data */
+	uint16_t count;			/* count of data in this packet */
 	ctl_pkt_u u;
 };
 


=====================================
ntpq/ntpq.c
=====================================
--- a/ntpq/ntpq.c
+++ b/ntpq/ntpq.c
@@ -797,17 +797,6 @@ openhost(
 		return false;
 	}
 
-
-#ifdef NEED_RCVBUF_SLOP
-# ifdef SO_RCVBUF
-	{ int rbufsize = DATASIZE + 2048;	/* 2K for slop */
-	if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
-		       &rbufsize, sizeof(int)) == -1)
-		error("setsockopt");
-	}
-# endif
-#endif
-
 	if (connect(sockfd, (struct sockaddr *)ai->ai_addr, ai->ai_addrlen)==-1)
 	{
 		error("connect");



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/82ebac653cc58c298b129b7a8d29a3b2abe1f255...caa153469ab5dd96df54be9269e9f84c8fe9709b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160711/b6a8a6fd/attachment.html>


More information about the vc mailing list