From 85fee9c0ed4d41d5bdb3a487c8a5ed1a8d9746f9 Mon Sep 17 00:00:00 2001 From: dtucker Date: Fri, 8 Jan 2010 08:53:52 +0000 Subject: [PATCH] - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make RoutingDomain an unsupported option on platforms that don't have it. --- ChangeLog | 2 ++ configure.ac | 5 +++++ misc.c | 4 ++++ readconf.c | 6 ++++++ servconf.c | 6 ++++++ ssh-keyscan.c | 6 ++++++ 6 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index d0fde0fb..440c8318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -159,6 +159,8 @@ - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines. - (dtucker) [sftp.c] ifdef out the sftp completion bits for platforms that don't have libedit. + - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make + RoutingDomain an unsupported option on platforms that don't have it. 20091226 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 diff --git a/configure.ac b/configure.ac index 71b313c5..af1f0321 100644 --- a/configure.ac +++ b/configure.ac @@ -1623,6 +1623,11 @@ if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "x ) fi +AC_CHECK_DECL(SO_RDOMAIN, + AC_DEFINE(USE_ROUTINGDOMAIN, 1, [Enable rdomain/VRF support]), , + [#include + #include ]) + dnl see whether mkstemp() requires XXXXXX if test "x$ac_cv_func_mkdtemp" = "xyes" ; then AC_MSG_CHECKING([for (overly) strict mkstemp]) diff --git a/misc.c b/misc.c index d4bdfc0e..db57f92b 100644 --- a/misc.c +++ b/misc.c @@ -155,6 +155,7 @@ set_nodelay(int fd) int socket_rdomain(int domain, int type, int protocol, int rdomain) { +#ifdef USE_ROUTINGDOMAIN int sock, ipproto = IPPROTO_IP; if ((sock = socket(domain, type, protocol)) == -1) @@ -186,6 +187,7 @@ socket_rdomain(int domain, int type, int protocol, int rdomain) } return (sock); +#endif } /* Characters considered whitespace in strsep calls. */ @@ -273,6 +275,7 @@ a2port(const char *s) return (int)port; } +#ifdef USE_ROUTINGDOMAIN int a2rdomain(const char *s) { @@ -284,6 +287,7 @@ a2rdomain(const char *s) return -1; return (int)rdomain; } +#endif int a2tun(const char *s, int *remote) diff --git a/readconf.c b/readconf.c index 40fe8f69..47c77472 100644 --- a/readconf.c +++ b/readconf.c @@ -229,7 +229,11 @@ static struct { { "permitlocalcommand", oPermitLocalCommand }, { "visualhostkey", oVisualHostKey }, { "useroaming", oUseRoaming }, +#ifdef USE_ROUTINGDOMAIN { "routingdomain", oRDomain }, +#else + { "routingdomain", oUnsupported }, +#endif #ifdef JPAKE { "zeroknowledgepasswordauthentication", oZeroKnowledgePasswordAuthentication }, @@ -920,6 +924,7 @@ parse_int: intptr = &options->use_roaming; goto parse_flag; +#ifdef USE_ROUTINGDOMAIN case oRDomain: arg = strdelim(&s); if (!arg || *arg == '\0') @@ -932,6 +937,7 @@ parse_int: if (*activep) options->rdomain = value; break; +#endif case oDeprecated: debug("%s line %d: Deprecated option \"%s\"", diff --git a/servconf.c b/servconf.c index 2cdc480e..9ad08ce8 100644 --- a/servconf.c +++ b/servconf.c @@ -424,7 +424,11 @@ static struct { { "match", sMatch, SSHCFG_ALL }, { "permitopen", sPermitOpen, SSHCFG_ALL }, { "forcecommand", sForceCommand, SSHCFG_ALL }, +#ifdef USE_ROUTINGDOMAIN { "routingdomain", sRDomain, SSHCFG_GLOBAL }, +#else + { "routingdomain", sUnsupported, SSHCFG_GLOBAL }, +#endif { "chrootdirectory", sChrootDirectory, SSHCFG_ALL }, { NULL, sBadOption, 0 } }; @@ -1296,6 +1300,7 @@ process_server_config_line(ServerOptions *options, char *line, *charptr = xstrdup(arg); break; +#ifdef USE_ROUTINGDOMAIN case sRDomain: intptr = &options->rdomain; arg = strdelim(&cp); @@ -1308,6 +1313,7 @@ process_server_config_line(ServerOptions *options, char *line, if (*intptr == -1) *intptr = value; break; +#endif case sDeprecated: logit("%s line %d: Deprecated option %s", diff --git a/ssh-keyscan.c b/ssh-keyscan.c index faeb9e13..086c0d34 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -807,11 +807,17 @@ main(int argc, char **argv) IPv4or6 = AF_INET6; break; case 'V': +#ifdef USE_ROUTINGDOMAIN scan_rdomain = a2rdomain(optarg); if (scan_rdomain == -1) { fprintf(stderr, "Bad rdomain '%s'\n", optarg); exit(1); } +#else + fprintf(stderr, "RoutingDomain not supported on this " + "platform.\n"); + exit(1); +#endif break; case '?': default: -- 2.45.1