| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
One special syntax is not supported anymore: "iface:port" would be parsed as an
interface name plus numerical port, equivalent to "[::]%iface:port". This was
added in 542563babda, but was undocumented, and we had no tests for it. It seems
that this actually wasn't doing anything useful, because the kernel only uses the
scope identifier for link-local addresses.
|
|
|
|
|
| |
With the commit "shared/socket-netlink: only allow ifindex if explicitly supported"
this helper is not necessary anymore.
|
|
|
|
|
|
|
|
|
| |
in_addr_port_ifindex_name_from_string_auto()
We don't try to resolve invalid ifnames as all. A different return
code is used. This difference will be verified later in test_socket_address_parse()
when socket_address_parse() is converted to use
in_addr_port_ifindex_name_from_string_auto().
|
|
|
|
|
|
|
|
| |
If the interface scope is specified, this changes the meaning of the address
quite significantly. Let's show the IPv6 scope_id if present.
Sadly we don't even have a test for sockaddr_pretty() output :(
This will be implicitly tested through socket_address_parse() later on.
|
| |
|
|
|
|
|
| |
Instead of ignoring ifindex if not wanted, refuse it is the caller
does not allow it.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
There is a small functional difference: IP_TTL==1 is now also set for the UDP
socket. I assume that it wasn't set by mistake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a minor functional change:
IPV6_FREEBIND is set of IPv6 sockets, not IP_FREEBIND. This was missed in
af8b1384, but I noticed only after the merging the two functions.
And a not-so-minor functional chagnge:
7216a3b5dcde36245 changed manager_dns_stub_tcp_fd_extra() to return the fd even
if the source was already initialized, but it didn't do the same change for
manager_dns_stub_udp_fd_extra(), so it would return 0 in that case. But
0354029bf572489b uses manager_dns_stub_udp_fd_extra() when preparing to call
manager_send(), and will pass 0 as the fd in that case. For both socket types
fd is now always returned.
|
|
|
|
| |
No functional change, preparation for subsequent refactoring.
|
|
|
|
|
|
| |
end of container
Prompted-by: https://lists.freedesktop.org/archives/systemd-devel/2020-September/045264.html
|
|\
| |
| | |
resolved: dns stub listener extra fixes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DnsPacket should better be a "dead" object, i.e. list facts, not track
resources. By including an fd in its fields it started tracking
resources however, without actually taking a ref to the fd (i.e. no
dup() or so was called on it).
Let's hence rework things so that we don#t have to keep track of the fd
a packet came in from. Instead, pass around the DnsStubListenerExtra
object wherever we need to.
This should be useful as soon as we start caching whole DnsPacket
objects to allow replying to DNSSEC/CO packets, i.e. where we have to
keep a copy of the original DnsPacket around for a long time in cache,
potentially much longer than the fds the packet was received on.
|
| |
| |
| |
| | |
Just some moving around, no logic changes.
|
| |
| |
| |
| |
| | |
All our other struct types use the "Dns" spelling, rather than "DNS". Do
the same for this struct.
|
|\ \
| | |
| | | |
fix two coverity issues
|
| | |
| | |
| | |
| | | |
Fixes: CID1432652
|
| | |
| | |
| | |
| | | |
Fixes: CID1432653
|
|/ /
| |
| |
| |
| | |
cryptsetup: Fix null pointer dereference
Fix null pointer dereference in the pkcs11 related code of systemd-cryptsetup
|
| |
| |
| |
| |
| | |
The two PRs #16664 and #16635 individually passed CI, but when combined
cannot build. Since both are merged now, let's fix that.
|
| |
| |
| |
| |
| |
| |
| | |
KEY_RESTART is widely used in Linux to indicate device reboot.
So lets handle it in the same fashion as KEY_POWER.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
|
| | |
|
|\ \
| | |
| | | |
Drop FOREACH_WORD
|
| | |
| | |
| | |
| | |
| | | |
Now that _full() is gone, we can rename _extract() to have the usual suffix
we use for the more featureful version.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Behaviour is not identical, as shown by the tests in test-strv.
The combination of EXTRACT_UNQUOTE without EXTRACT_RELAX only appears in
the test, so it doesn't seem particularly important. OTOH, the difference
in handling of squished parameters could make a difference. New behaviour
is what both bash and python do, so I think we can ignore this corner case.
This change has the following advantages:
- the duplication of code paths that do a very similar thing is removed
- extract_one_word() / strv_split_extract() return a proper error code.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The tricky part here is that the function is not allowed to fail in this code
path. Initially, I wanted to change the return value to allow it to fail, but
this cascades through all the places where fstab_test_option() and friends are
used; updating all those sites would be a lot of work. And since quoting is not
allowed here, a simple loop with strcspn() is easy to do.
|
| | |
| | |
| | |
| | | |
No functional change. I'm keeping this separate to make review easier.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This is much nicer, and also fixes a potential overflow when we used
'word' in log_error() as if it was a NUL-terminated string.
|
| | |
| | |
| | |
| | | |
Nowadays we do that almost everywhere, let's also do it here.
|
| | |
| | |
| | |
| | |
| | | |
If we fail to parse the index, the failure is propogated as -EUNCLEAN.
(-EINVAL would be confused with invalid args to the function itself.)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
sd_seat_get_sessions() would return 0 in the 'n_uids' (now 'ret_n_uids') output
parameter when 'uid' (now 'ret_uids') was passed as NULL.
While at it, drop FOREACH_WORD() use.
Also use any whitespace as separator. In practice this shouldn't matter, since
logind always uses spaces, but it seems nicer to not specify this explicitly,
and the default is more flexible.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
I had to move STRV_MAKE to macro.h. There is a circular dependency between
extract-word.h, strv.h, and string-util.h that makes it hard to define the
inline function otherwise.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This wraps the common pattern of using extract_first_word() in a loop
to look for a matching word.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Ambient capabilities documenation and keep-caps usage corrections
|