summaryrefslogtreecommitdiff
path: root/src/test/test-socket-netlink.c
Commit message (Collapse)AuthorAgeFilesLines
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* Use sockaddr_un_set_path() in socket_address_parse()Zbigniew Jędrzejewski-Szmek2020-09-101-1/+1
| | | | | | | | Two functional changes: - "/" is now refused. The test is adjusted. - The trailing NUL is *not* included in the returned size for abstract size. The comments in sockaddr_un_set_path() indicate that this is the right thing to do, and the code in socket_address_parse() wasn't doing that.
* Allow interface scopes to be specified in ListenStream=Zbigniew Jędrzejewski-Szmek2020-09-101-17/+33
| | | | | | | | | | Closes #12624. The formatting in systemd.socket.xml is updated a bit. Currently in_addr_port_ifindex_name_to_string() always prints the ifindex numerically. This is not super useful since the interface numbers are semi-random. Should we use interface names in preference?
* shared: don't unconditionally set SOCK_STREAM as type in socket_address_parse()Zbigniew Jędrzejewski-Szmek2020-09-101-2/+7
| | | | | | | | | | 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.
* Get rid of in_addr_port_from_string_auto() againZbigniew Jędrzejewski-Szmek2020-09-101-31/+0
| | | | | With the commit "shared/socket-netlink: only allow ifindex if explicitly supported" this helper is not necessary anymore.
* shared/socket-netlink: only allow ifindex if explicitly supportedZbigniew Jędrzejewski-Szmek2020-09-101-8/+49
| | | | | Instead of ignoring ifindex if not wanted, refuse it is the caller does not allow it.
* test-socket-netlink: print the proper expected stringZbigniew Jędrzejewski-Szmek2020-09-101-4/+12
| | | | | | We would use the return value from the tested function to decide what to print as "expected", which is confusing when something is wrong with the tested function.
* util: drop unused socket_addr_port_from_string_auto()Yu Watanabe2020-09-041-36/+0
|
* test: add tests for in_addr_port_from_string_auto()Yu Watanabe2020-09-041-0/+31
|
* test: move several tests from test-socket-util.cYu Watanabe2020-09-041-0/+108
|
* shared: Introduce socket_addr_port_from_string_autoSusant Sahani2020-09-021-0/+36
|
* util-lib: move things that parse ifnames to shared/Zbigniew Jędrzejewski-Szmek2020-01-111-0/+227
In subsequent commits, calls to if_nametoindex() will be replaced by a wrapper that falls back to alternative name resolution over netlink. netlink support requires libsystemd (for sd-netlink), and we don't want to add any functions that require netlink in basic/. So stuff that calls if_nametoindex() for user supplied interface names, and everything that depends on that, needs to be moved.