diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2026-08-10 20:44:28 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2026-08-10 20:50:22 +0000 |
| commit | 618dc484b5817b7a7560632410c9ca5c32c85a84 (patch) | |
| tree | b6698ec2f33c3fe388f80ce0c72f06ee4e6496d4 | |
| parent | e70e25761fca7607dfee8b8cfbd902cb1c9806cd (diff) | |
tests/netinet/socket_afinet: add more tests to multibind
Add tests where first socket and second socket are bound to different
addresses, e.g. first specific and second wildcard and vice versa.
Mark success with SO_REUSEPORT on the second socket as a bug suspect.
Mark failure to bind to INADDR_ANY in presence of other UID's specific
bound socket to the same port as probably too strict.
Differential Revision: https://reviews.freebsd.org/D58088
| -rw-r--r-- | tests/sys/netinet/socket_afinet.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index d0c09be18a7c..4d82108f1822 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -462,6 +462,12 @@ ATF_TC_BODY(multibind, tc) { SOCK_STREAM, LB, x, ADDR, x, F, F }, { SOCK_STREAM, LB, x, PORT, x, F, F }, { SOCK_STREAM, LB, x, LB, x, R, F }, + { SOCK_STREAM, 0, x, 0, o, F, F }, + { SOCK_STREAM, 0, x, ADDR, o, R, F }, + { SOCK_STREAM, 0, x, PORT, o, R, F }, /* bug? */ + { SOCK_STREAM, 0, o, 0, x, F, F }, + { SOCK_STREAM, 0, o, ADDR, x, R, F }, /* too strict? */ + { SOCK_STREAM, 0, o, PORT, x, R, F }, /* bug? */ /* * ATM, expected result for SOCK_DGRAM is the same as for * SOCK_STREAM. Thus the below is copy-and-paste of the above. @@ -498,6 +504,12 @@ ATF_TC_BODY(multibind, tc) { SOCK_DGRAM, LB, x, ADDR, x, F, F }, { SOCK_DGRAM, LB, x, PORT, x, F, F }, { SOCK_DGRAM, LB, x, LB, x, R, F }, + { SOCK_DGRAM, 0, x, 0, o, F, F }, + { SOCK_DGRAM, 0, x, ADDR, o, R, F }, + { SOCK_DGRAM, 0, x, PORT, o, R, F }, /* bug? */ + { SOCK_DGRAM, 0, o, 0, x, F, F }, + { SOCK_DGRAM, 0, o, ADDR, x, R, F }, /* too strict? */ + { SOCK_DGRAM, 0, o, PORT, x, R, F }, /* bug? */ #undef F #undef R #undef x |
