Skip to content

Commit

Permalink
bpf: sockmap put client sockets in blocking mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Fastabend authored and Daniel Borkmann committed Jan 24, 2018
1 parent ce5373b commit ede1547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/sockmap/sockmap_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()");
Expand Down

0 comments on commit ede1547

Please sign in to comment.