[Compile Issue] netcat.c on HP NonStop

Damien Miller djm at mindrot.org
Tue Apr 14 08:27:14 AEST 2015

On Mon, 13 Apr 2015, Randall S. Becker wrote:

> Greetings,
> I am porting the openssh-portable 6.8 release to the HP NonStop (NSE)
> platform. Prior versions were no real problem, with minor tweeks. However,
> with the inclusion of regress/netcat.c, which depends on arpa/telnet.h, we
> have an issue. Unfortunately, the platform does not have this file, nor
> anything like it - telnet is done rather differently. We do have a version
> of netcat (0.7.1 a.k.a. "really old") ported. Is there a reasonably
> documentable way to configure the regression tests so that this dependency
> is either not executed or uses an installed version?

We only need a few of the constants from that header, and they are fixed
values for the telnet protocol so we can just include them directly.

Could you please try this patch?

diff --git a/regress/netcat.c b/regress/netcat.c
index 1a9fc87..6234ba0 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -42,7 +42,6 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <netinet/ip.h>
-#include <arpa/telnet.h>
 #include <errno.h>
 #include <netdb.h>
@@ -63,6 +62,13 @@
 # endif
+/* Telnet options from arpa/telnet.h */
+#define IAC	255
+#define DONT	254
+#define DO	253
+#define WONT	252
+#define WILL	251
 #ifndef SUN_LEN
 #define SUN_LEN(su) \
 	(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))

More information about the openssh-unix-dev mailing list