The sctp_recvmsg() function passes the value of the *msg_flags argument
to the recvmsg(2) system call [1], but in sctp_server.c the flags
variable is never initialized. This lead to sctp_recvmsg() sometimes
returning -EAGAIN, because the garbage flags sometimes marked the
recvmsg(2) call as non-blocking.
Since the function allows to pass NULL in msg_flags and we do not care
about the returned flags, let's just pass NULL and remove the flags
variable entirely.
The sctp_recvmsg() function passes the value of the *msg_flags argument to the recvmsg(2) system call [1], but in sctp_server.c the flags variable is never initialized. This lead to sctp_recvmsg() sometimes returning -EAGAIN, because the garbage flags sometimes marked the recvmsg(2) call as non-blocking.
Since the function allows to pass NULL in msg_flags and we do not care about the returned flags, let's just pass NULL and remove the flags variable entirely.
[1] https://github.com/sctp/lksctp-tools/blob/356de6906c5b6d563f2d0568e86e3875ad482c66/src/lib/recvmsg.c#L77
Fixes: c38b57ffdac4 ("selinux-testsuite: Add SCTP test support") Signed-off-by: Ondrej Mosnacek omosnace@redhat.com