1 #==============================================================================
2 # Set IP address defaults with respect to IPV6 support
4 # This file determines the level of support for IPV4, IPV4 mapped or IPV6, then
5 # sets the appropriate localhost IP format to use for 'connect()' commands.
7 # Input: $my_socket_debug - Print results of IP version check (optional)
8 # Output: $my_localhost - Default localhost IP
9 #==============================================================================
11 let $check_ipv6_just_check= 1;
12 #--source include/check_ipv6.inc
14 #==============================================================================
15 # Determine if IPV6 supported
18 # $check_ipv6_just_check - Don't skip the test if IPv6 is unsupported,
19 # just set the variable $check_ipv6_supported
20 #==============================================================================
23 --disable_abort_on_error
25 let $check_ipv6_supported= 1;
27 connect (checkcon123456789,::1,root,,
test);
31 let $check_ipv6_supported=0;
32 if(!$check_ipv6_just_check)
40 disconnect checkcon123456789;
41 --source include/wait_until_disconnected.inc
46 --enable_abort_on_error
50 #==============================================================================
52 # Determine if IPV4 mapped to IPV6 supported
54 let $check_ipv4_mapped_just_check= 1;
55 #--source include/check_ipv4_mapped.inc
56 #==============================================================================
57 # Check if ipv4 mapped to ipv6 is available.
60 # $check_ipv4_mapped_just_check - Don't skip the test if IPv4 mapped is unsupported,
61 # just set the variable $check_ipv4_mapped_supported
62 #==============================================================================
65 --disable_abort_on_error
67 let $check_ipv4_mapped_supported= 1;
69 connect (checkcon123456789a,::FFFF:127.0.0.1,root,,
test);
73 let $check_ipv4_mapped_supported=0;
74 if(!$check_ipv4_mapped_just_check)
76 skip No mapped IPv4 support;
82 disconnect checkcon123456789a;
83 --source include/wait_until_disconnected.inc
88 --enable_abort_on_error
92 #==============================================================================
93 # Set the localhost IP default to use when establishing connections
95 #==============================================================================
96 let $my_localhost=127.0.0.1;
98 if($check_ipv6_supported)
100 let $my_localhost=::1;
103 if($check_ipv4_mapped_supported)
105 let $my_localhost=::ffff:127.0.0.1;
110 --echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
112 #==============================================================================