OSDN Git Service

bpf: sockmap put client sockets in blocking mode
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 22 Jan 2018 18:36:53 +0000 (10:36 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 24 Jan 2018 09:46:59 +0000 (10:46 +0100)
Put client sockets in blocking mode otherwise with sendmsg tests
its easy to overrun the socket buffers which results in the test
being aborted.

The original non-blocking was added to handle listen/accept with
a single thread the client/accepted sockets do not need to be
non-blocking.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/sockmap/sockmap_user.c

index f9d3785..fe943c9 100644 (file)
@@ -109,7 +109,7 @@ static int sockmap_init_sockets(void)
        }
 
        /* Non-blocking sockets */
-       for (i = 0; i < 4; i++) {
+       for (i = 0; i < 2; i++) {
                err = ioctl(*fds[i], FIONBIO, (char *)&one);
                if (err < 0) {
                        perror("ioctl s1 failed()");