|
Lines 64-69
Link Here
|
| 64 |
options->ports_from_cmdline = 0; |
64 |
options->ports_from_cmdline = 0; |
| 65 |
options->listen_addrs = NULL; |
65 |
options->listen_addrs = NULL; |
| 66 |
options->address_family = -1; |
66 |
options->address_family = -1; |
|
|
67 |
options->ip_protocol = -1; |
| 67 |
options->num_host_key_files = 0; |
68 |
options->num_host_key_files = 0; |
| 68 |
options->pid_file = NULL; |
69 |
options->pid_file = NULL; |
| 69 |
options->server_key_bits = -1; |
70 |
options->server_key_bits = -1; |
|
Lines 152-157
Link Here
|
| 152 |
_PATH_HOST_DSA_KEY_FILE; |
153 |
_PATH_HOST_DSA_KEY_FILE; |
| 153 |
} |
154 |
} |
| 154 |
} |
155 |
} |
|
|
156 |
if (options->ip_protocol == -1) |
| 157 |
options->ip_protocol = IPPROTO_TCP; |
| 155 |
if (options->num_ports == 0) |
158 |
if (options->num_ports == 0) |
| 156 |
options->ports[options->num_ports++] = SSH_DEFAULT_PORT; |
159 |
options->ports[options->num_ports++] = SSH_DEFAULT_PORT; |
| 157 |
if (options->listen_addrs == NULL) |
160 |
if (options->listen_addrs == NULL) |
|
Lines 306-312
Link Here
|
| 306 |
sMatch, sPermitOpen, sForceCommand, sChrootDirectory, |
309 |
sMatch, sPermitOpen, sForceCommand, sChrootDirectory, |
| 307 |
sUsePrivilegeSeparation, sAllowAgentForwarding, |
310 |
sUsePrivilegeSeparation, sAllowAgentForwarding, |
| 308 |
sZeroKnowledgePasswordAuthentication, |
311 |
sZeroKnowledgePasswordAuthentication, |
| 309 |
sDeprecated, sUnsupported |
312 |
sIPProtocol, sDeprecated, sUnsupported |
| 310 |
} ServerOpCodes; |
313 |
} ServerOpCodes; |
| 311 |
|
314 |
|
| 312 |
#define SSHCFG_GLOBAL 0x01 /* allowed in main section of sshd_config */ |
315 |
#define SSHCFG_GLOBAL 0x01 /* allowed in main section of sshd_config */ |
|
Lines 424-429
Link Here
|
| 424 |
{ "permitopen", sPermitOpen, SSHCFG_ALL }, |
427 |
{ "permitopen", sPermitOpen, SSHCFG_ALL }, |
| 425 |
{ "forcecommand", sForceCommand, SSHCFG_ALL }, |
428 |
{ "forcecommand", sForceCommand, SSHCFG_ALL }, |
| 426 |
{ "chrootdirectory", sChrootDirectory, SSHCFG_ALL }, |
429 |
{ "chrootdirectory", sChrootDirectory, SSHCFG_ALL }, |
|
|
430 |
{ "ipprotocol", sIPProtocol, SSHCFG_GLOBAL }, |
| 427 |
{ NULL, sBadOption, 0 } |
431 |
{ NULL, sBadOption, 0 } |
| 428 |
}; |
432 |
}; |
| 429 |
|
433 |
|
|
Lines 482-489
Link Here
|
| 482 |
char strport[NI_MAXSERV]; |
486 |
char strport[NI_MAXSERV]; |
| 483 |
int gaierr; |
487 |
int gaierr; |
| 484 |
|
488 |
|
|
|
489 |
next: |
| 485 |
memset(&hints, 0, sizeof(hints)); |
490 |
memset(&hints, 0, sizeof(hints)); |
| 486 |
hints.ai_family = options->address_family; |
491 |
hints.ai_family = options->address_family; |
|
|
492 |
hints.ai_protocol = options->ip_protocol ? options->ip_protocol : IPPROTO_TCP; |
| 487 |
hints.ai_socktype = SOCK_STREAM; |
493 |
hints.ai_socktype = SOCK_STREAM; |
| 488 |
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; |
494 |
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; |
| 489 |
snprintf(strport, sizeof strport, "%d", port); |
495 |
snprintf(strport, sizeof strport, "%d", port); |
|
Lines 495-500
Link Here
|
| 495 |
; |
501 |
; |
| 496 |
ai->ai_next = options->listen_addrs; |
502 |
ai->ai_next = options->listen_addrs; |
| 497 |
options->listen_addrs = aitop; |
503 |
options->listen_addrs = aitop; |
|
|
504 |
#ifdef IPPROTO_SCTP |
| 505 |
if (options->ip_protocol) |
| 506 |
return; |
| 507 |
options->ip_protocol = IPPROTO_SCTP; |
| 508 |
goto next; |
| 509 |
#endif |
| 498 |
} |
510 |
} |
| 499 |
|
511 |
|
| 500 |
/* |
512 |
/* |
|
Lines 1294-1299
Link Here
|
| 1294 |
*charptr = xstrdup(arg); |
1306 |
*charptr = xstrdup(arg); |
| 1295 |
break; |
1307 |
break; |
| 1296 |
|
1308 |
|
|
|
1309 |
case sIPProtocol: |
| 1310 |
#ifdef IPPROTO_SCTP |
| 1311 |
intptr = &options->ip_protocol; |
| 1312 |
arg = strdelim(&cp); |
| 1313 |
if (!arg || *arg == '\0') |
| 1314 |
fatal("%s line %d: Missing argument.", filename, linenum); |
| 1315 |
value = 0; /* silence compiler */ |
| 1316 |
if (strcmp(arg, "tcp") == 0) |
| 1317 |
value = IPPROTO_TCP; |
| 1318 |
else if (strcmp(arg, "sctp") == 0) |
| 1319 |
value = IPPROTO_SCTP; |
| 1320 |
else if (strcmp(arg, "both") == 0) |
| 1321 |
value = 0; |
| 1322 |
else |
| 1323 |
fatal("%s line %d: Bad tcp/sctp/both " , filename, linenum); |
| 1324 |
if (*intptr == IPPROTO_SCTP) |
| 1325 |
*intptr = value; |
| 1326 |
#endif |
| 1327 |
|
| 1297 |
case sDeprecated: |
1328 |
case sDeprecated: |
| 1298 |
logit("%s line %d: Deprecated option %s", |
1329 |
logit("%s line %d: Deprecated option %s", |
| 1299 |
filename, linenum, arg); |
1330 |
filename, linenum, arg); |