summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-03-05 20:37:24 +0100
committerLennart Poettering <lennart@poettering.net>2021-03-05 20:51:43 +0100
commit83e03c4fc23dae0cbb3fd4e7c2f9ef533fc26160 (patch)
treec845bc8964a79188bbe4a97efb94368f7adb5960 /src/test
parent571ec995fe035557d4166ae310f627bdf307714b (diff)
downloadsystemd-83e03c4fc23dae0cbb3fd4e7c2f9ef533fc26160.tar.gz
socket-util: add helper for checking if IPv6 is enabled
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-socket-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index 4ff7d714f8..584253c2fc 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -504,6 +504,11 @@ static void test_flush_accept(void) {
assert_se(flush_accept(listen_seqpacket) >= 0);
}
+static void test_ipv6_enabled(void) {
+ log_info("IPv6 supported: %s", yes_no(socket_ipv6_is_supported()));
+ log_info("IPv6 enabled: %s", yes_no(socket_ipv6_is_enabled()));
+}
+
int main(int argc, char *argv[]) {
test_setup_logging(LOG_DEBUG);
@@ -519,6 +524,7 @@ int main(int argc, char *argv[]) {
test_send_nodata_nofd();
test_send_emptydata();
test_flush_accept();
+ test_ipv6_enabled();
return 0;
}