Files
Jim Newsome 26a4eb7ed4 test_connect: fix raw socket test
When running as non-root, we fail to create the socket in the first
place. This happened to cause the test to pass, since it resulted in
errno being set to `EBADF` when we tried to `connect` on it.

We now check whether creation of the socket succeeded, and if not we
skip this particular test.

When running as root (as in CI), the test would *sometimes* still pass,
because we were passing an uninitialized `sockaddr_sin`. If it didn't
happen to have one of the allowed address families then we would  still
get `EBADF` as the test expected. If it just happened to have one of the
allowed families though, then we get `EPERM`.

We now initialize `sin` so that we're not depending on uninitialized
data, and particularly set the family to `AF_INET` to ensure we're
exercising the code path that rejects unsupported socket types, not the
earlier check that rejects unsupported address families.

With that fixed, the expected errno is `EPERM` instead of `EBADF`.
2025-03-12 10:37:20 -05:00
..
2025-03-12 10:37:20 -05:00
2017-02-24 13:46:24 -05:00
2017-02-24 13:46:24 -05:00
2025-03-11 23:10:08 -05:00
2021-11-12 15:57:36 +02:00