[Git][NTPsec/ntpsec][master] Experimentally remove RFC2553 shims to see if any of the builbots barfs.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Sep 13 12:02:54 UTC 2016


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


Commits:
84942199 by Eric S. Raymond at 2016-09-13T07:59:37-04:00
Experimentally remove RFC2553 shims to see if any of the builbots barfs.

This is a probe to see if our whole platform renge is RFC2553-conformant.
If it is, we can permanently drop what's left of include/ntp_rfc2553.h

- - - - -


5 changed files:

- include/ntp_net.h
- − include/ntp_rfc2553.h
- ntpdig/main.c
- ntpdig/networking.h
- ntpq/ntpq.c


Changes:

=====================================
include/ntp_net.h
=====================================
--- a/include/ntp_net.h
+++ b/include/ntp_net.h
@@ -9,8 +9,9 @@
 #include <sys/socket.h>
 #include <net/if.h>
 #include <netinet/in.h>
+#include <netdb.h>
+#include <isc/net.h>
 
-#include "ntp_rfc2553.h"
 #include "ntp_malloc.h"
 
 typedef union {


=====================================
include/ntp_rfc2553.h deleted
=====================================
--- a/include/ntp_rfc2553.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)in.h	8.3 (Berkeley) 1/3/94
- */
-
-/*
- * Compatability shims with the rfc2553 API to simplify ntp.
- */
-#ifndef GUARD_NTP_RFC2553_H
-#define GUARD_NTP_RFC2553_H
-
-#include <netdb.h>
-#include <isc/net.h>
-
-#include "ntp_types.h"
-#include "ntp_malloc.h"
-
-/*
- * If various macros are not defined we need to define them
- */
-
-#if !defined(_SS_MAXSIZE) && !defined(_SS_ALIGNSIZE)
-
-# define	_SS_MAXSIZE	128
-# define	_SS_ALIGNSIZE	(sizeof(ntp_uint64_t))
-# ifdef ISC_PLATFORM_HAVESALEN
-#  define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(uint8_t) - sizeof(ntp_u_int8_t))
-#  define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(uint8_t) - sizeof(ntp_u_int8_t) - \
-				_SS_PAD1SIZE - _SS_ALIGNSIZE)
-# else
-#  define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(short))
-#  define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(short) - \
-				_SS_PAD1SIZE - _SS_ALIGNSIZE)
-# endif /* ISC_PLATFORM_HAVESALEN */
-#endif
-
-#ifndef INET6_ADDRSTRLEN
-# define	INET6_ADDRSTRLEN	46	/* max len of IPv6 addr in ascii */
-#endif
-
-/*
- * Finally if the platform doesn't support IPv6 we need some
- * additional definitions
- */
-
-/*
- * Flag values for getaddrinfo()
- */
-#ifndef AI_PASSIVE
-#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
-#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
-#define	AI_NUMERICHOST	0x00000004 /* prevent name resolution */
-/* valid flags for addrinfo */
-#define AI_MASK \
-    (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG)
-
-#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
-#endif	/* !AI_PASSIVE */
-
-#ifndef AI_NUMERICHOST		/* such as AIX 4.3 */
-# define Z_AI_NUMERICHOST	0
-#else
-# define Z_AI_NUMERICHOST	AI_NUMERICHOST
-#endif
-
-#ifndef AI_NUMERICSERV		/* not in RFC 2553 */
-# define Z_AI_NUMERICSERV	0
-#else
-# define Z_AI_NUMERICSERV	AI_NUMERICSERV
-#endif
-
-#endif /* !GUARD_NTP_RFC2553_H */


=====================================
ntpdig/main.c
=====================================
--- a/ntpdig/main.c
+++ b/ntpdig/main.c
@@ -530,7 +530,7 @@ handle_lookup(
 
 	ZERO(hints);
 	hints.ai_family = ai_fam_pref;
-	hints.ai_flags = AI_CANONNAME | Z_AI_NUMERICSERV;
+	hints.ai_flags = AI_CANONNAME | AI_NUMERICSERV;
 	/*
 	** Unless we specify a socktype, we'll get at least two
 	** entries for each address: one for TCP and one for


=====================================
ntpdig/networking.h
=====================================
--- a/ntpdig/networking.h
+++ b/ntpdig/networking.h
@@ -12,7 +12,6 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#include <ntp_rfc2553.h>
 #include <ntp_stdlib.h>
 #include <ntp_machine.h>
 #include <ntp_unixtime.h>


=====================================
ntpq/ntpq.c
=====================================
--- a/ntpq/ntpq.c
+++ b/ntpq/ntpq.c
@@ -698,7 +698,7 @@ openhost(
 	hints.ai_family = fam;
 	hints.ai_protocol = IPPROTO_UDP;
 	hints.ai_socktype = SOCK_DGRAM;
-	hints.ai_flags = Z_AI_NUMERICHOST;
+	hints.ai_flags = AI_NUMERICHOST;
 	ai = NULL;
 
 	a_info = getaddrinfo(hname, svc, &hints, &ai);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/84942199aa0db03f8a63a68fec51ae9b667e5c5c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160913/e744f2b8/attachment.html>


More information about the vc mailing list