diff options
author | John Fastabend <john.fastabend@gmail.com> | 2018-08-28 19:10:45 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-29 18:29:54 +0300 |
commit | b5d83fec732dc98e37b22e8b20a7943aa0bb55d9 (patch) | |
tree | 1f19eeeabc81e56ff6ad4a920a55901ac89d8e19 /tools/testing/selftests/bpf/test_sockmap.c | |
parent | efbaec89c642cd1d4977fc6df9923697e1598d4e (diff) | |
download | linux-b5d83fec732dc98e37b22e8b20a7943aa0bb55d9.tar.xz |
bpf: sockmap test remove shutdown() calls
Currently, we do a shutdown(sk, SHUT_RDWR) on both peer sockets and
a shutdown on the sender as well. However, this is incorrect and can
occasionally cause issues if you happen to have bad timing. First
peer1 or peer2 may still be in use depending on the test and timing.
Second we really should only be closing the read side and/or write
side depending on if the test is receiving or sending.
But, really none of this is needed just remove the shutdown calls.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_sockmap.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_sockmap.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 0c7d9e556b47..a0e77c6bb0cf 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -469,8 +469,6 @@ static int sendmsg_test(struct sockmap_options *opt) fprintf(stderr, "msg_loop_rx: iov_count %i iov_buf %i cnt %i err %i\n", iov_count, iov_buf, cnt, err); - shutdown(p2, SHUT_RDWR); - shutdown(p1, SHUT_RDWR); if (s.end.tv_sec - s.start.tv_sec) { sent_Bps = sentBps(s); recvd_Bps = recvdBps(s); @@ -500,7 +498,6 @@ static int sendmsg_test(struct sockmap_options *opt) fprintf(stderr, "msg_loop_tx: iov_count %i iov_buf %i cnt %i err %i\n", iov_count, iov_buf, cnt, err); - shutdown(c1, SHUT_RDWR); if (s.end.tv_sec - s.start.tv_sec) { sent_Bps = sentBps(s); recvd_Bps = recvdBps(s); |