On April 13, 2015 6:27 PM, Damien Miller wrote:> 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
> #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))
I have wrapped the changes in our platform's __TANDEM #define. (patch below)
There's a bit more to it, unfortunately, but the patches were helpful. Still
missing are: POLLNVAL, POLLHUP, IPTOS_PREC_CRITIC_ECP,
IPTOS_PREC_INTERNETCONTROL, IPTOS_PREC_NETCONTROL - which are just not
appropriate to the platform.
I have #ifdef'd around those and tested. The version in regress/netcat.c is
radically different from the 0.7.1 version we have as a port - some
comparisons there are not too practical.
The test failures with my workaround fail are as follows, but I suspect are
completely unrelated - possibly our non-standard SSH ports:
run test connect.sh ...
ssh connect with protocol 1 failed
ssh connect with protocol 2 failed
I don't think this is a regression from 6.7 in our environment.
Cheers,
Randall
diff --git a/regress/netcat.c b/regress/netcat.c
index 1a9fc87..2c8d301 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -42,7 +42,23 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netinet/ip.h>
+#if defined __TANDEM
+#include <arpa/inet.h>
+/* 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))
+# endif
+
+#else
#include <arpa/telnet.h>
+#endif
#include <errno.h>
#include <netdb.h>
@@ -868,21 +884,30 @@ readwrite(int net_fd)
/* treat socket error conditions */
for (n = 0; n < 4; n++) {
+#if defined __TANDEM
+ if (pfd[n].revents & (POLLERR)) {
+#else
if (pfd[n].revents & (POLLERR|POLLNVAL)) {
+#endif
pfd[n].fd = -1;
}
}
/* reading is possible after HUP */
if (pfd[POLL_STDIN].events & POLLIN &&
+#if ! defined __TANDEM
pfd[POLL_STDIN].revents & POLLHUP &&
+#endif
! (pfd[POLL_STDIN].revents & POLLIN))
pfd[POLL_STDIN].fd = -1;
if (pfd[POLL_NETIN].events & POLLIN &&
+#if ! defined __TANDEM
pfd[POLL_NETIN].revents & POLLHUP &&
+#endif
! (pfd[POLL_NETIN].revents & POLLIN))
pfd[POLL_NETIN].fd = -1;
+#if ! defined __TANDEM
if (pfd[POLL_NETOUT].revents & POLLHUP) {
if (Nflag)
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
@@ -891,6 +916,7 @@ readwrite(int net_fd)
/* if HUP, stop watching stdout */
if (pfd[POLL_STDOUT].revents & POLLHUP)
pfd[POLL_STDOUT].fd = -1;
+#endif
/* if no net out, stop watching stdin */
if (pfd[POLL_NETOUT].fd == -1)
pfd[POLL_STDIN].fd = -1;
@@ -1244,7 +1270,9 @@ map_tos(char *s, int *val)
{ "af41", IPTOS_DSCP_AF41 },
{ "af42", IPTOS_DSCP_AF42 },
{ "af43", IPTOS_DSCP_AF43 },
+#if ! defined __TANDEM
{ "critical", IPTOS_PREC_CRITIC_ECP },
+#endif
{ "cs0", IPTOS_DSCP_CS0 },
{ "cs1", IPTOS_DSCP_CS1 },
{ "cs2", IPTOS_DSCP_CS2 },
@@ -1254,9 +1282,13 @@ map_tos(char *s, int *val)
{ "cs6", IPTOS_DSCP_CS6 },
{ "cs7", IPTOS_DSCP_CS7 },
{ "ef", IPTOS_DSCP_EF },
+#if ! defined __TANDEM
{ "inetcontrol", IPTOS_PREC_INTERNETCONTROL },
+#endif
{ "lowdelay", IPTOS_LOWDELAY },
+#if ! defined __TANDEM
{ "netcontrol", IPTOS_PREC_NETCONTROL },
+#endif
{ "reliability", IPTOS_RELIABILITY },
{ "throughput", IPTOS_THROUGHPUT },
{ NULL, -1 },