shared: don't unconditionally set SOCK_STREAM as type in socket_address_parse()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Sep 2020 21:51:21 +0000 (23:51 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 9 Sep 2020 22:46:44 +0000 (00:46 +0200)
commit44ab234734907dbf08fae80a57dae01d9f0b2d0f
treeb20b47b47c8c2baa1c61c2ec7ef36b5a95b6d0bf
parent75af1666d7476ee77f47bcc2e6c415c040326eb9
shared: don't unconditionally set SOCK_STREAM as type in socket_address_parse()

We would set .type to a fake value. All real callers (outside of tests)
immediately overwrite .type with a proper value after calling
socket_address_parse(). So let's not set it and adjust the few places
that relied on it being set to the fake value.

socket_address_parse() is modernized to only set the output argument on
success.
src/basic/socket-util.c
src/shared/socket-netlink.c
src/test/test-socket-netlink.c