NetworkManager/src/libnm-platform/tests
Thomas Haller f96fbc8ebe
platform/netlink: combine nl_socket_alloc() and nl_connect()
Create and use new nl_socket_new().

nl_socket_alloc() really does nothing but allocating the struct and
initializing the fd to -1. In all cases, we want to call nl_connect()
right after.

Combine the two. Then we also cannot  have a "struct nl_sock" without a
valid fd. This means several error checks can be dropped.

Note that former nl_connect() did several things at once. Maybe, for
more flexibility one would need to tweak what should be done there.
For now that is not necessary. In any case, if we need more flexibility,
then we would control what nl_connect() (now nl_socket_new()) does, and not
the split between nl_socket_alloc() and nl_connect().
2022-06-17 19:40:20 +02:00
..
meson.build build/meson: cleanup tests 2021-02-28 18:56:08 +01:00
test-nm-platform.c platform/netlink: combine nl_socket_alloc() and nl_connect() 2022-06-17 19:40:20 +02:00