diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1372,6 +1372,18 @@ check_ip_options(struct ssh *ssh) | |||
1372 | static void | 1372 | static void |
1373 | set_process_rdomain(struct ssh *ssh, const char *name) | 1373 | set_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 | /* |