network/test_net: add support for -6 option (IPv6 tests)

* copy read_opts() from net_cmdlib.sh library;
* replace TST_EXEC_SUFFIX with more informative name TST_IPV6;

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
network/test_net: add tst_ipaddr

Some tests require IP addresses, either IPv4 or IPv6.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
network/test_net: add functions to manage IP addresses

* tst_init_iface() cleanup test interface
* tst_add_ipaddr() add default IPv4 or IPv6 address
* tst_restore_ipaddr() cleanup interface, then
  add default IPv4 and Ipv6 addresses

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
network/stress/broken_ip: move common code to library

Move common code to local libraries:
broken_ipv4_lib.sh and broken_ipv6_lib.sh.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
network/ping: cleanup test, use new net library

Remove -R (record route) option from ping because:
* IPv6 doesn't support record route;
* many hosts ignore or discard the option;

Also, previous version didn't use EXEC_PREFIX to test ping6

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
network/sendfile01: cleanup test, apply new net library

This test require remote host IP address. Don't get it from RHOST,
get the one from network.sh. It is done because RHOST may be set as
management link and we don't want test traffic on it.

Also, test used 'rsh' without input redirection to /dev/null. It could block
the test, see bug section in rsh man page.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
network/tcpdump01: cleanup test, use new library

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
network/runtests: remove ipv6_expect, ipv6_noexpect

Some of the tests from ipv6 groups are broken because there is
no corresponding script/binary, another just duplicate tcp_cmds
groups and not related to ipv6, some needed changes in RHOST to run
over ipv6. So, keep only fixed tests in the ipv6 runtest file.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
network/tcp_fastopen: add support for IPv6

Support for TCP Fast Open over IPv6 has been added to Linux 3.16.
Determine IP protocol from defined IP address. Also, make use of IPv6
server socket because it is backward compatible with IPv4 connections.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>