Skip to content

Commit

Permalink
BUG/MINOR: do not close uninit FD in quic_test_socketops()
Browse files Browse the repository at this point in the history
On startup, quic_test_socketops() is called to ensure that chosen
configuration option are compatible with UDP system stack. A dummy FD is
allocated to invoke various setsockopt() settings.

If no tests are required, FD is not allocated. In this case, close()
should not be close. This is mostly for better coding as this does not
cause any real issue for users.

This should fix github issue #2638.

No need to backport.
  • Loading branch information
a-denoyelle committed Jul 16, 2024
1 parent 05f33e9 commit d57b95a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/proto_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ static int quic_test_socketopts(struct listener *l)
#endif
}

close(fdtest);
if (fdtest >= 0)
close(fdtest);
return ERR_NONE;

err:
Expand Down

0 comments on commit d57b95a

Please sign in to comment.