Skip to content

samples: net: echo_client: sample runs failed with prj_qemu_x86_tls.conf configuration file #7423

@xianrenqiu

Description

@xianrenqiu

Summary

In zephyr/samples/net/echo_client sample, when using the prj_qemu_x86.conf configuration file, the sample runs successfully, but using the prj_qemu_x86_tls.conf configuration file, the sample runs failed. Error code is EBUSY(-16, TLS handshake not yet done ?).

Setup

1. branch info
zephyr branch: zephyr-v1.11.0
net-tools branch: master (commit 17e31b)

2. terminal #1 linux <--> qemu
$ cd net-tools
$ ./loop-socat.sh &
$ sudo ./loop-slip-tap.sh
# tap0 info
tap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.0.2.2  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::a870:87ff:fec6:6114  prefixlen 64  scopeid 0x20<link>
        inet6 2001:db8::2  prefixlen 64  scopeid 0x0<global>
        ether aa:70:87:c6:61:14  txqueuelen 1000
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Failed (prj_qemu_x86_tls.conf)

# terminal #2 run stunnel
$ cd net-tools
$ ./stunnel.sh
# output info
2018.05.11 09:15:39 LOG5[ui]: stunnel 5.44 on x86_64-pc-linux-gnu platform
2018.05.11 09:15:39 LOG5[ui]: stunnel 5.44 on x86_64-pc-linux-gnu platform
2018.05.11 09:15:39 LOG5[ui]: Compiled/running with OpenSSL 1.1.0g  2 Nov 2017
2018.05.11 09:15:39 LOG5[ui]: Compiled/running with OpenSSL 1.1.0g  2 Nov 2017
2018.05.11 09:15:39 LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
2018.05.11 09:15:39 LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
2018.05.11 09:15:39 LOG5[ui]: Reading configuration from file /root/share/repo/net-tools/stunnel.conf
2018.05.11 09:15:39 LOG5[ui]: Reading configuration from file /root/share/repo/net-tools/stunnel.conf
2018.05.11 09:15:39 LOG5[ui]: UTF-8 byte order mark not detected
2018.05.11 09:15:39 LOG5[ui]: UTF-8 byte order mark not detected
2018.05.11 09:15:39 LOG5[ui]: FIPS mode disabled
2018.05.11 09:15:39 LOG5[ui]: FIPS mode disabled
2018.05.11 09:15:39 LOG4[ui]: Insecure file permissions on echo-apps-key.pem
2018.05.11 09:15:39 LOG4[ui]: Insecure file permissions on echo-apps-key.pem
2018.05.11 09:15:39 LOG4[ui]: Insecure file permissions on echo-apps-key.pem
2018.05.11 09:15:39 LOG4[ui]: Insecure file permissions on echo-apps-key.pem
2018.05.11 09:15:39 LOG5[ui]: Configuration successful
2018.05.11 09:15:39 LOG5[ui]: Configuration successful

# terminal #3 echo_server
$ ./echo-server -p 4244 -i tap0
# output info
IPv4: binding to 192.0.2.2
IPv6: binding to 2001:db8::2
Sockets: UPD IPv4 3 IPv6 4, mcast IPv4 5 IPv6 6, TCP IPv4 7 IPv6 8
Socket 3 binding to 192.0.2.2
Socket 4 binding to 2001:db8::2
Socket 5 binding to 239.192.0.2
Socket 6 binding to ff84::2
Socket 7 binding to 192.0.2.2
Socket 8 binding to 2001:db8::2

# terminal #4 echo_client
$ cd <zephyr>/samples/net/echo_client
$ mkdir build && cd build
$ cmake -DBOARD=qemu_x86 -DCONF_FILE=prj_qemu_x86_tls.conf ..
$ make run
# output info
qemu-system-i386: warning: Unknown firmware file in legacy mode: genroms/multiboot.bin

***** BOOTING ZEPHYR OS v1.11.0 - BUILD: May 11 2018 01:16:18 *****
Zephyr Shell, Zephyr version: 1.11.0
Type 'help' for a list of available commands
shell> [echo-client] [INF] init_app: Run echo client
[echo-client] [ERR] send_tcp_data: Cannot send IPv4 data to peer (-16)
[echo-client] [DBG] tcp_received: (0x00401408): IPv6: Sent 536 bytes, received 536 bytes
[echo-client] [DBG] compare_tcp_data: (0x00401408): Compared 536 bytes, all ok

# after runs echo_client,  terminal #2 output: 
2018.05.11 09:16:29 LOG5[0]: Service [echo-server-ipv6] accepted connection from 2001:db8::1:47420
2018.05.11 09:16:29 LOG5[0]: Service [echo-server-ipv6] accepted connection from 2001:db8::1:47420
2018.05.11 09:16:29 LOG5[0]: s_connect: connected 2001:db8::2:4244
2018.05.11 09:16:29 LOG5[0]: s_connect: connected 2001:db8::2:4244
2018.05.11 09:16:29 LOG5[0]: Service [echo-server-ipv6] connected remote server from 2001:db8::2:60492
2018.05.11 09:16:29 LOG5[0]: Service [echo-server-ipv6] connected remote server from 2001:db8::2:60492
2018.05.11 09:16:29 LOG5[1]: Service [echo-server-ipv4] accepted connection from 192.0.2.1:60583
2018.05.11 09:16:29 LOG5[1]: Service [echo-server-ipv4] accepted connection from 192.0.2.1:60583
2018.05.11 09:16:29 LOG5[1]: s_connect: connected 192.0.2.2:4244
2018.05.11 09:16:29 LOG5[1]: s_connect: connected 192.0.2.2:4244
2018.05.11 09:16:29 LOG5[1]: Service [echo-server-ipv4] connected remote server from 192.0.2.2:38478
2018.05.11 09:16:29 LOG5[1]: Service [echo-server-ipv4] connected remote server from 192.0.2.2:38478

Metadata

Metadata

Labels

area: NetworkingbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions