vcl: fix iperf3 server crash issue when it runs over vpp host stack.

Issue:

Let iperf3 server run via ldp and vcl on top of vpp's host stack. If
iperf3 client connects this iperf3 server with tcp MSS setting option,
iperf3 server will always crash.

Root cause:

When MSS option is specified by iperf3 client, iperf3 server will
recreate the listening socket firstly, then call setsockopt() to set MSS
immediately. Iperf3 code can be referred here:
58332f8154/src/iperf_tcp.c (L186).
However, in vcl layer vpp_evt_q of this recreated session is not
allocated yet. So iperf3 server crashes with vpp_evt_q null pointer access.

Fix:

Add session vpp_evt_q null pointer check in vcl_session_transport_attr().
Add a vcl test case for this MSS option scenario.

Type: fix
Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2863bd0cffbe6e60108ab333f97c00530c006ba7
This commit is contained in:
Liangxing Wang
2022-05-13 04:24:19 +00:00
committed by Florin Coras
parent 0d5f1a6c54
commit 2211277f3a
2 changed files with 19 additions and 1 deletions

View File

@ -193,6 +193,7 @@ class VCLTestCase(VppTestCase):
i.unconfig_ip4()
i.set_table_ip4(0)
i.admin_down()
i.remove_vpp_config()
def thru_host_stack_ipv6_setup(self):
self.vapi.session_enable_disable(is_enable=1)
@ -932,6 +933,16 @@ class LDPThruHostStackIperf(VCLTestCase):
iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
)
@unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
def test_ldp_thru_host_stack_iperf3_mss(self):
"""run LDP thru host stack iperf3 test with mss option"""
self.timeout = self.client_iperf3_timeout
self.client_iperf3_args.append("-M 1000")
self.thru_host_stack_test(
iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
)
class LDPThruHostStackIperfUdp(VCLTestCase):
"""LDP Thru Host Stack Iperf UDP"""