aboutsummaryrefslogtreecommitdiffstats
path: root/community/libreswan/0001-posix-use-HOST_NAME_MAX-consitently-from-limits.h.patch
blob: 2d2d9fbb1c218fd19d14ec4e906845512b6f04ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From ee7952c5112a2b08c1b196cabd946e0b3c3dc74a Mon Sep 17 00:00:00 2001
From: Antony Antony <antony@phenome.org>
Date: Mon, 14 Aug 2017 20:52:18 +0200
Subject: [PATCH] posix: use HOST_NAME_MAX consitently from limits.h

---
 lib/libswan/id.c                | 5 +----
 ports/linux/include/sysdep.h    | 2 +-
 programs/pluto/ikev2_ipseckey.c | 2 +-
 programs/pluto/rcv_whack.c      | 4 ----
 4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/lib/libswan/id.c b/lib/libswan/id.c
index 06cc751..b89650a 100644
--- a/lib/libswan/id.c
+++ b/lib/libswan/id.c
@@ -22,10 +22,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <unistd.h>
-#ifndef HOST_NAME_MAX	/* POSIX 1003.1-2001 says <unistd.h> defines this */
-#define HOST_NAME_MAX 255	/* upper bound, according to SUSv2 */
-#endif
 
 #include <libreswan.h>
 
@@ -34,6 +30,7 @@
 #include "libreswan/passert.h"
 #include "lswalloc.h"
 #include "lswlog.h"
+#include "sysdep.h"
 #include "id.h"
 #include "x509.h"
 #include <cert.h>
diff --git a/ports/linux/include/sysdep.h b/ports/linux/include/sysdep.h
index deb2ac1..b782b2c 100644
--- a/ports/linux/include/sysdep.h
+++ b/ports/linux/include/sysdep.h
@@ -5,7 +5,7 @@
 #define TimeZoneOffset timezone
 
 #include <limits.h>
-/* POSIX 1003.1-2001 says <unistd.h> defines this */
+/* POSIX 1003.1-2001 says <limits.h> defines this */
 #ifndef HOST_NAME_MAX
 /* some don't even use _POSIX_HOST_NAME_MAX */
 # ifdef _POSIX_HOST_NAME_MAX
diff --git a/programs/pluto/ikev2_ipseckey.c b/programs/pluto/ikev2_ipseckey.c
index 45872ef..1d32d37 100644
--- a/programs/pluto/ikev2_ipseckey.c
+++ b/programs/pluto/ikev2_ipseckey.c
@@ -22,7 +22,6 @@
 #include <string.h>
 #include <stddef.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <errno.h>
 #include <arpa/inet.h> /* for inet_ntop */
 #include <arpa/nameser.h>
@@ -31,6 +30,7 @@
 #include "unbound-event.h"
 #include "libreswan.h"
 #include "lswlog.h"
+#include "sysdep.h"
 #include "defs.h"
 #include "log.h"
 #include "constants.h" /* for demux.h */
diff --git a/programs/pluto/rcv_whack.c b/programs/pluto/rcv_whack.c
index baa9fdf..9a53ed5 100644
--- a/programs/pluto/rcv_whack.c
+++ b/programs/pluto/rcv_whack.c
@@ -28,10 +28,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
-#ifndef HOST_NAME_MAX           /* POSIX 1003.1-2001 says <unistd.h> defines this */
-# define HOST_NAME_MAX  255     /* upper bound, according to SUSv2 */
-#endif
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-- 
2.9.4