summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2017-10-25 13:10:59 +1100
committerDamien Miller <djm@mindrot.org>2017-10-25 13:11:38 +1100
commit43c29bb7cfd46bbbc61e0ffa61a11e74d49a712f (patch)
tree6f50beda7b60d6efaa85369407b9874730559b68 /sshd.c
parent3235473bc8e075fad7216b7cd62fcd2b0320ea04 (diff)
provide hooks and fallbacks for rdomain support
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sshd.c b/sshd.c
index 1220309d7..535cb97f0 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1372,6 +1372,18 @@ check_ip_options(struct ssh *ssh)
1372static void 1372static void
1373set_process_rdomain(struct ssh *ssh, const char *name) 1373set_process_rdomain(struct ssh *ssh, const char *name)
1374{ 1374{
1375#if defined(HAVE_SYS_SET_PROCESS_RDOMAIN)
1376 if (name == NULL)
1377 return; /* default */
1378
1379 if (strcmp(name, "%D") == 0) {
1380 /* "expands" to routing domain of connection */
1381 if ((name = ssh_packet_rdomain_in(ssh)) == NULL)
1382 return;
1383 }
1384 /* NB. We don't pass 'ssh' to sys_set_process_rdomain() */
1385 return sys_set_process_rdomain(name);
1386#elif defined(__OpenBSD__)
1375 int rtable, ortable = getrtable(); 1387 int rtable, ortable = getrtable();
1376 const char *errstr; 1388 const char *errstr;
1377 1389
@@ -1391,6 +1403,9 @@ set_process_rdomain(struct ssh *ssh, const char *name)
1391 fatal("Unable to set routing domain %d: %s", 1403 fatal("Unable to set routing domain %d: %s",
1392 rtable, strerror(errno)); 1404 rtable, strerror(errno));
1393 debug("%s: set routing domain %d (was %d)", __func__, rtable, ortable); 1405 debug("%s: set routing domain %d (was %d)", __func__, rtable, ortable);
1406#else /* defined(__OpenBSD__) */
1407 fatal("Unable to set routing domain: not supported in this platform");
1408#endif
1394} 1409}
1395 1410
1396/* 1411/*