connect: Support AddressFamily option

* allow parsing of AddressFamily in config and cli
  * supports options "any", "inet" and "inet6"
* introduce SSH_OPTIONS_ADDRESS_FAMILY

Signed-off-by: Samir Benmendil <me@rmz.io>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Samir Benmendil
2025-12-15 19:16:15 +00:00
parent f52be27114
commit c4f1a70a89
10 changed files with 247 additions and 12 deletions

View File

@@ -1352,6 +1352,7 @@ static void torture_options_copy(void **state)
"GSSAPIDelegateCredentials yes\n"
"PubkeyAuthentication yes\n" /* sets flags */
"GSSAPIAuthentication no\n" /* sets flags */
"AddressFamily inet6\n"
"",
config);
fclose(config);
@@ -1428,6 +1429,7 @@ static void torture_options_copy(void **state)
assert_true(session->opts.config_processed == new->opts.config_processed);
assert_memory_equal(session->opts.options_seen, new->opts.options_seen,
sizeof(session->opts.options_seen));
assert_int_equal(session->opts.address_family, new->opts.address_family);
ssh_free(new);