Commit graph

37372 commits

Author SHA1 Message Date
Lennart Poettering 7172e4ee1e resolved: implicitly disconnect a stream from its server when a stream is closed
Previously, the callback function did this, but let's do this in the
caller instead, to make this more robust, and use our new helper
function for it.
2018-12-07 17:22:59 +01:00
Lennart Poettering 808089ae3d resolved: add new helper for carefully detach a stream from any server
This adds a helper call for detaching a DnsServer from a DnsStream if
the latter is the "default" stream of the server.

Also, let's unref the stream in dns_stream_stop() rather than
dns_stream_free(): as soon as our stream is disconnected by stopping
there's really no need to keep it as default stream for the server
around.

Since dns_stream_free() calls dns_stream_stop() we can remove it from
the former.
2018-12-07 17:22:59 +01:00
Lennart Poettering d973d94dec resolved: pin stream while calling callbacks for it
These callbacks might unref the stream, but we still have to access it,
let's hence ref it explicitly.

Maybe fixes: #10725
2018-12-07 17:22:59 +01:00
Lennart Poettering 904dcaf9d4 resolved: take particular care when detaching DnsServer from its default stream
DnsStream and DnsServer have a symbiotic relationship: one DnsStream is
the current "default" stream of the server (and thus reffed by it), but
each stream also refs the server it is connected to. This cyclic
dependency can result in weird situations: when one is
destroyed/unlinked/stopped it needs to unregister itself from the other,
but doing this will trigger unregistration of the other. Hence, let's
make sure we unregister the stream from the server before destroying it,
to break this cycle.

Most likely fixes: #10725
2018-12-07 17:16:29 +01:00
Lennart Poettering 199dda9c25 resolved: before assuming we have a server, check we are talking DNS and not LLMNR/mDNS 2018-12-07 17:16:29 +01:00
Lennart Poettering 51bc63fef2 resolved: comment headers better 2018-12-07 17:16:29 +01:00
Lennart Poettering ec962fba62 resolved: add small helper to pick DNS port number
This shouldn't be hidden in some function argument expression. Let's
make this more explicit by turning this into its own helper function.
2018-12-07 17:16:29 +01:00
Lennart Poettering 747a8a74c0 resolved: rename dns_stream_on_packet() → on_stream_packet()
Let's name this similar to on_stream_complete(). Moreover we shouldn't
invade dns_stream's namespace if we are a consumer of it.
2018-12-07 17:16:29 +01:00
Lennart Poettering 65b0179a25 resolved: use structured initialization for DnsServer allocation 2018-12-07 17:16:29 +01:00
Lennart Poettering 94fdb4d9d1 resolved: exit early on failure 2018-12-07 17:16:29 +01:00
Lennart Poettering 97d5d9055f resolved: don't read packet from DnsStream on on_stream_complete() of DnsTransaction
We register an on_packet() handler anyway, which is called first.
There's hence no need to check in on_stream_complete() again, as it is
already taken by that time.
2018-12-07 17:16:29 +01:00
Lennart Poettering aa337a5e72 resolved: add new accessor dns_stream_take_read_packet() for taking read packet from stream
This ensures the packet is complete when it is taken out, and resets
n_read so that we can start reading the next one.
2018-12-07 17:16:29 +01:00
Lennart Poettering 56e267dee2 resolved: remove redundant code 2018-12-07 17:16:29 +01:00
Lennart Poettering 499aa1d31b resolved: add some assert()s 2018-12-07 17:16:29 +01:00
Lennart Poettering e6dc55566b resolved: be more careful with types in dns_stream_writev()
Let's not name a variable of type ssize_t "r". We usually use "r" for
return values of API calls that return some kind of error as in int.
This creates a lot of confusion if used differently here, which actually
resulted in connect()'s return value being assigned to this mistyped "r"
by accident.

Let's rename the variable "m" hence, and not use it for connect() return
values.
2018-12-07 17:16:29 +01:00
Lennart Poettering b27a32a0de resolved: line split dns_stream_new() function signature 2018-12-07 17:16:29 +01:00
Lennart Poettering 08e254c818 resolved: reorder things, to place registration of DnsStream in Manager close to each other 2018-12-07 17:16:29 +01:00
Lennart Poettering 898892e825 resolved: ensure DnsStream.fd is initialized before first error path 2018-12-07 17:16:29 +01:00
Lennart Poettering b2cf6704e7 resolved: simplify on_stream_io() a bit 2018-12-07 17:16:29 +01:00
Evgeny Vereshchagin 1478aa4eb5 travis: also compile systemd on Debian Testing
This should help to catch issues like https://github.com/systemd/systemd/issues/11075
2018-12-07 17:12:58 +01:00
Filipe Brandenburger 01dc8e3044 man: fix reference to sd_journal_print(3)
The reference in systemd-journald.service(8) was incorrectly pointing to
man volume 4 instead of 3.

This commit should fix the broken link at
https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
2018-12-07 13:35:35 +01:00
Yu Watanabe 5b139f86a6 missing: re-add drm related entries
This effectively reverts dab28f0905.

Fixes #11075.
2018-12-07 12:46:55 +01:00
Yu Watanabe 83da42c3bf bash-completion: analyze: support 'security' 2018-12-07 08:05:18 +01:00
Zbigniew Jędrzejewski-Szmek 9b73c84739
Merge pull request #11072 from yuwata/fix-networkctl-ip6gre
networkctl: fix TYPE field of ip6gre devices
2018-12-07 08:03:32 +01:00
Yu Watanabe 925fb1e1ec missing: add ARPHRD_IP6GRE
This fixes TYPE field of networkctl's output for ip6gre devices.
2018-12-07 11:48:41 +09:00
Yu Watanabe 0b7d48f5f4 af-list,arphrd-list: also include relevant missing_*.h headers 2018-12-07 11:48:41 +09:00
Yu Watanabe 18bf324ab5 journal: use missing_audit.h to generate audit_type-list.txt 2018-12-07 11:48:37 +09:00
Yu Watanabe 54480d649f cap-list: use missing_capabilty.h to generate list of capabilities 2018-12-07 11:31:22 +09:00
Yu Watanabe eeef672f0c
Merge pull request #11038 from keszybz/man-timeouts
Small improvements for documentation of timeout options
2018-12-07 02:53:40 +01:00
Zbigniew Jędrzejewski-Szmek 2e7e19cafc systemctl: be nice to users and give hint how to specify "-.mount"
https://bugzilla.redhat.com/show_bug.cgi?id=1656639
Using "--" is a trick that is hard to discover. Let's give users a hint:

$ build/systemctl status -.service
  build/systemctl: invalid option -- '.'
  Hint: to specify units starting with a dash, use "--":
        build/systemctl [OPTIONS...] {COMMAND} -- -.service ...

I use program_invocation_name because that's what getopt seems to use.
"::" is used in the option string so that getopt doesn't complain about
a missing argument in case somebody passes "-." as the argument. After all
"." is not a real option.
2018-12-07 02:49:03 +01:00
Zbigniew Jędrzejewski-Szmek 0f495e0123 shared/blkid-util: do not include util.h needlessly 2018-12-07 02:49:03 +01:00
Yu Watanabe a81921e47e Revert "pager: close all fds when forking off pager"
This reverts commit 55844aebb6.

As `exe_name_pipe` are closed by safe_fork().
2018-12-06 21:15:55 +01:00
Yu Watanabe e1eb35db1e
Merge pull request #11056 from poettering/resolved-ifindex
resolved: request incoming ifindex for DNS UDP packets, too
2018-12-06 19:29:42 +01:00
Yu Watanabe 1df69c94b1
Merge pull request #11066 from yuwata/test-network-tiny-cleanups
test-network: several cleanups
2018-12-06 19:16:53 +01:00
Alexey Bogdanenko 487e33242f test-resolved: fix error code check in assertion
If file "/etc/hosts" does not exist, fopen fails and sets errno to ENOENT
("No such file or directory"). So errno should be compared with ENOENT.

This mistake causes test test-resolved-etc-hosts to fail when run on Debian
image built with mkosi.debian included in the repo. The image does not include
"/etc/hosts" file as it is not created by debootstrap, see debootstrap manpage
https://manpages.debian.org/stretch/debootstrap/debootstrap.8.en.html.
2018-12-06 17:23:05 +01:00
Zbigniew Jędrzejewski-Szmek 871fa294ff Merge pull request #10935 from poettering/rlimit-nofile-safe
Merged by hand to resolve a trivial conflict in TODO.
2018-12-06 17:19:21 +01:00
Yu Watanabe f0a43eb821
Merge pull request #11063 from yuwata/update-missing-v3
missing: split missing.h into small pieces
2018-12-06 16:54:27 +01:00
Yu Watanabe 131717cbb4 test-network: make search_words_in_file() hit multi words 2018-12-06 16:48:42 +01:00
Yu Watanabe e4eacdb09f test-network: delete rules before running next test 2018-12-06 16:48:42 +01:00
Yu Watanabe fa7cd60281 test-network: add a line break after starting networkd
This may be ugly. But otherwise, outputs of several check commands
are shown without new line...
2018-12-06 16:48:42 +01:00
Yu Watanabe e40a58b5bc test-network: check link before starting dnsmasq 2018-12-06 16:48:42 +01:00
Yu Watanabe 14ecd604a4 test-network: show command outputs 2018-12-06 16:48:41 +01:00
Yu Watanabe a9bc5e370e test-network: sort imported modules 2018-12-06 16:48:41 +01:00
Yu Watanabe 09ea6724e7 test-network: sort links and units 2018-12-06 16:48:41 +01:00
Yu Watanabe 14dc033574 test-network: fix typo in class name 2018-12-06 16:48:41 +01:00
Zbigniew Jędrzejewski-Szmek 2d479ff1cc
Merge pull request #10963 from poettering/bus-force-state-change-signal
force PropertiesChanged bus signal on all unit state changes
2018-12-06 16:42:21 +01:00
Paweł Szewczyk 6dce3bb401 fd-util: Fix error handling in safe_fclose
Function fclose_nointr returns negative value on error.
2018-12-06 16:15:39 +01:00
Zbigniew Jędrzejewski-Szmek a91f96ad39
Merge pull request #10994 from poettering/sd-bus-tweaks
small sd-bus tweaks
2018-12-06 15:26:05 +01:00
Yu Watanabe 801503d22b
Merge pull request #10988 from ssahani/IFLA_BRPORT_MCAST_TO_UCAST
networkd: bridge add support to configure multicast_to_unicast
2018-12-06 14:32:52 +01:00
Yu Watanabe fda96700e4
Merge pull request #11032 from ssahani/invert-rule
networkd: RPDB rule - add support to configure inverted rule.
2018-12-06 14:27:36 +01:00