summaryrefslogtreecommitdiff
path: root/src/resolve
Commit message (Collapse)AuthorAgeFilesLines
* bus: use bus_log_parse_error to print messagefangxiuning2020-07-121-1/+1
|
* Merge pull request #16385 from JackFangXN/masterLennart Poettering2020-07-081-3/+3
|\ | | | | table add table_log_xx_error()
| * table use table_log_print_error() instead of table_log_show_errorfangxiuning2020-07-081-3/+3
| |
* | Merge pull request #16344 from keszybz/update-utmp-erofsLennart Poettering2020-07-061-1/+1
|\ \ | |/ |/| Make update-utmp not fail if it only fails to write wtmp records
| * various daemons: emit Stopping... notification before destructing the ↵Zbigniew Jędrzejewski-Szmek2020-07-021-1/+1
| | | | | | | | | | | | | | | | manager object This is mostly cosmetic, but let's reorder the destructors so that we do the final sd_notify() call before we run the destructor for the manager object.
* | Merge pull request #16338 from keszybz/spelling2Zbigniew Jędrzejewski-Szmek2020-07-023-15/+15
|\ \ | | | | | | Tree-wide spelling fixes
| * | tree-wide: "unparseable" → "unparsable"Zbigniew Jędrzejewski-Szmek2020-07-023-15/+15
| |/ | | | | | | | | "unparsable" is the more common spelling. We already pick "movable" over "moveable". Let's do the same with this pair.
* | resolve: use appropriate typeYu Watanabe2020-07-021-1/+1
|/
* shared: split out property get helpersLennart Poettering2020-06-302-2/+2
| | | | No code changes, just some refactoring.
* shared: split out code that maps properties to local structsLennart Poettering2020-06-301-0/+1
| | | | Just some refactoring, no code changes.
* shared: actually move all BusLocator related calls to bus-locator.cLennart Poettering2020-06-301-1/+1
|
* shared: split out BusObjectImplementor APIsLennart Poettering2020-06-302-2/+2
| | | | Just some refactoring, no code changes
* tree-wide: avoid some loaded termsLennart Poettering2020-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | https://tools.ietf.org/html/draft-knodel-terminology-02 https://lwn.net/Articles/823224/ This gets rid of most but not occasions of these loaded terms: 1. scsi_id and friends are something that is supposed to be removed from our tree (see #7594) 2. The test suite defines an API used by the ubuntu CI. We can remove this too later, but this needs to be done in sync with the ubuntu CI. 3. In some cases the terms are part of APIs we call or where we expose concepts the kernel names the way it names them. (In particular all remaining uses of the word "slave" in our codebase are like this, it's used by the POSIX PTY layer, by the network subsystem, the mount API and the block device subsystem). Getting rid of the term in these contexts would mean doing some major fixes of the kernel ABI first. Regarding the replacements: when whitelist/blacklist is used as noun we replace with with allow list/deny list, and when used as verb with allow-list/deny-list.
* Merge pull request #16238 from keszybz/set-handling-moreZbigniew Jędrzejewski-Szmek2020-06-248-111/+45
|\ | | | | Fix handling of cases where a duplicate item is added to a set and related cleanups
| * tree-wide: use set_ensure_consume() in various placesZbigniew Jędrzejewski-Szmek2020-06-241-3/+1
| | | | | | | | No funtional change.
| * resolved: fix memleak on duplicate host lines in /etc/hostsZbigniew Jędrzejewski-Szmek2020-06-241-2/+1
| |
| * resolved: simplify allocation failure handling in dns_stub_process_query()Zbigniew Jędrzejewski-Szmek2020-06-241-16/+14
| | | | | | | | Old code was correct, but let's make things more explicit.
| * tree-wide: use set_ensure_put()Zbigniew Jędrzejewski-Szmek2020-06-227-62/+13
| | | | | | | | | | | | | | | | | | Patch contains a coccinelle script, but it only works in some cases. Many parts were converted by hand. Note: I did not fix errors in return value handing. This will be done separate to keep the patch comprehensible. No functional change is intended in this patch.
| * resolved: introduce dns_transaction_gcp()Zbigniew Jędrzejewski-Szmek2020-06-224-37/+25
| |
* | log: introduce log_parse_environment_cli() and log_setup_cli()Filipe Brandenburger2020-06-241-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities.
* | Make failures of mac_selinux_init() fatalChristian Göttsche2020-06-231-1/+1
| |
* | Merge pull request #16059 from keszybz/resolve-single-label-namesLennart Poettering2020-06-227-37/+40
|\ \ | |/ |/| Optionally resolve single label names
| * resolved: optionally allow single-label A/AAAA queriesZbigniew Jędrzejewski-Szmek2020-06-186-28/+32
| |
| * resolved: drop bit-field annotations for fields in ManagerZbigniew Jędrzejewski-Szmek2020-06-181-2/+2
| | | | | | | | | | | | | | Access to bit fields is less efficient, and since the Manager is a singleton, a byte or two of space in the structure doesn't matter at all. (And in this particular case, because of alignment issues, we wouldn't save anything anyway.)
| * resolved: add dns_query_candidate_freep()Zbigniew Jędrzejewski-Szmek2020-06-182-7/+6
| |
* | resolved: Log the feature level we're downgrading from as wellDaan De Meyer2020-06-131-2/+2
| |
* | resolved: Don't complain too much when downgrading from EDNSDaan De Meyer2020-06-121-3/+8
| |
* | resolve: enable RES_TRUSTAD towards the 127.0.0.53 stub resolverYmrDtnJu2020-06-062-2/+2
| | | | | | | | | | | | | | glibc 2.31 strips the AD flag, unless either the application specifies RES_TRUSTAD or the options in resolv.conf contain trust-ad. See https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD
* | Merge pull request #16057 from keszybz/resolvectl-sorted-no-ntaYu Watanabe2020-06-041-25/+43
|\ \ | |/ |/| Drop NTA lists from resolvectl status and sort output by link number
| * resolvect: sort status output by link numberZbigniew Jędrzejewski-Szmek2020-06-031-12/+40
| | | | | | | | | | | | This makes the output more predictable. Also, interesting interfaces are often the low-numbered ones (actual hardware links, not virtual devices stacked on top), and this makes them more visible.
| * resolvectl,systemctl: reduce scope of variablesZbigniew Jędrzejewski-Szmek2020-06-031-4/+3
| |
| * resolvectl: do not show NTA lists in statusZbigniew Jędrzejewski-Szmek2020-06-031-9/+0
| | | | | | | | | | | | | | Those lists are very long and use up a significant chunk of screen real estate. But the contents are mostly static (usually they just reflect built-in configuration). Let's just not show them in 'status' output. They can still be viewed with 'nta' verb.
* | conf-parser: return mtime in config_parse() and friendsLennart Poettering2020-06-022-9/+15
|/ | | | | | | | | | | | | This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86. Instead of reading the mtime off the configuration files after reading, let's do so before reading, but with the fd we read the data from. This is not only cleaner (as it allows us to save one stat()), but also has the benefit that we'll detect changes that happen while we read the files. This also reworks unit file drop-ins to use the common code for determining drop-in mtime, instead of reading system clock for that.
* network: also read mtime of drop-in configsYu Watanabe2020-06-011-1/+1
| | | | Fixes #15521.
* resolved: tweak cmsg calculationLennart Poettering2020-05-271-0/+1
| | | | | | | | We ask for the TTL, then have enough space for it. We probably can drop the extra cmsg space now, but let's figure that out another time, since the extra cmsg space is used elsewhere in resolved as well.
* resolved-dns-query: remove dns_query_candidate_is_routableFlorian Klink2020-05-261-28/+0
| | | | | | | | | | | | | | | | | | | Resolved can't reliably determine on whether "it makes sense" to query AAAA records when not explicitly specifying it in the request, so we shouldn't remove them. After having done the resolving, applications can use RFC6724 to determine whether that address is reachable. We can't know whether an address is reachable before having resolved it and inspecting the routing table, and not resolving AAAA just because there's no IPv6 default route on the main interface link them breaks various setups, including IPv6-providing wireguard tunnels on a non-dualstacked environment. Fixes #5782 Fixes #5915 Fixes #8017
* tree-wide: codespell fixesFrantisek Sumsal2020-05-251-1/+1
| | | | Another batch of codespell fixes as reported by Fossies.org
* Merge pull request #15804 from poettering/hostnamed-instant-part1Zbigniew Jędrzejewski-Szmek2020-05-182-3/+6
|\ | | | | four likely safe commits split out of #15624
| * resolved: port to stat_inode_unmodified()Lennart Poettering2020-05-132-3/+6
| |
* | tree-wide: Initialize _cleanup_ variables if neededBenjamin Robin2020-05-131-1/+1
|/
* netlink: port to recvmsg_safe()Lennart Poettering2020-05-121-0/+1
| | | | | | | | | | | | | | | | | | This also makes sure the control buffer is properly aligned. This matters, as otherwise the control buffer might not be aligned and the cmsg buffer counting might be off. The incorrect alignment is becoming visible by using recvmsg_safe() as we suddenly notice the MSG_CTRUNC bit set because of this. That said, apparently this isn't enough to make this work on all kernels. Since I couldn't figure this out, we now add 1K to the buffer to be sure. We do this once already, also for a pktinfo structure (though an IPv4/IPv6) one. I am puzzled by this, but this shouldn't matter much. it works locally just fine, except for those ubuntu CI kernels... While we are at it, make some other changes too, to simplify and modernize the function.
* Merge pull request #15460 from elmarco/network-dhcp-resolve1Lennart Poettering2020-05-115-83/+1
|\ | | | | network: fallback on resolve1 DNS for DHCP
| * shared: move in_addr_ifindex_name_from_string_auto() thereMarc-André Lureau2020-05-075-83/+1
| |
* | Merge pull request #15623 from poettering/cmsg-cleanupZbigniew Jędrzejewski-Szmek2020-05-082-23/+12
|\ \ | |/ |/| various CMSG_xyz clean-ups, split out of #15571
| * tree-wide: make sure our control buffers are properly alignedLennart Poettering2020-05-072-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | We always need to make them unions with a "struct cmsghdr" in them, so that things properly aligned. Otherwise we might end up at an unaligned address and the counting goes all wrong, possibly making the kernel refuse our buffers. Also, let's make sure we initialize the control buffers to zero when sending, but leave them uninitialized when reading. Both the alignment and the initialization thing is mentioned in the cmsg(3) man page.
| * tree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffersLennart Poettering2020-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | We need to use the CMSG_SPACE() macro to size the control buffers, not CMSG_LEN(). The former is rounded up to next alignment boundary, the latter is not. The former should be used for allocations, the latter for encoding how much of it is actually initialized. See cmsg(3) man page for details about this. Given how confusing this is, I guess we don't have to be too ashamed here, in most cases we actually did get this right.
* | Merge pull request #15681 from vcaputo/buslocatorVito Caputo2020-05-071-236/+37
|\ \ | | | | | | *: switch to BusLocator-oriented helpers
| * | resolve: switch to BusLocator-oriented helpersVito Caputo2020-05-071-236/+37
| |/ | | | | | | Mechanical substitution reducing some verbosity
* | Merge pull request #15635 from keszybz/set-put-strdupZbigniew Jędrzejewski-Szmek2020-05-073-4/+3
|\ \ | |/ |/| Let set_put_strdup() allocate the set and related changes
| * basic/set: let set_put_strdup() create the set with string hash opsZbigniew Jędrzejewski-Szmek2020-05-063-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're using a set with _put_strdup(), most of the time we want to use string hash ops on the set, and free the strings when done. This defines the appropriate a new string_hash_ops_free structure to automatically free the keys when removing the set, and makes set_put_strdup() and set_put_strdupv() instantiate the set with those hash ops. hashmap_put_strdup() was already doing something similar. (It is OK to instantiate the set earlier, possibly with a different hash ops structure. set_put_strdup() will then use the existing set. It is also OK to call set_free_free() instead of set_free() on a set with string_hash_ops_free, the effect is the same, we're just overriding the override of the cleanup function.) No functional change intended.