summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* util: move percent/permille/permyriad parser into percent-util.[ch]Lennart Poettering2021-02-1816-294/+327
| | | | | | | A good chunk of parse-util.[ch] has been about parsing parts per hundred/thousand/ten-thousand. Let's split that out into its own file. No code changes, just some shuffling around.
* main: let's use physical_memory_scale() where appropriateLennart Poettering2021-02-181-2/+2
| | | | | This way we can take benefit of the fact that physical_memory_scale() aligns on page sizes.
* tree-wide: parse permyriads wherever we canLennart Poettering2021-02-186-22/+22
| | | | | | Given that we now have a parser for permyriads, let's use it everywhere for greater accuracy. This means wherever we previously supported % and ‰, we now also support ‱.
* limits-util: tweak overflow checks for ↵Lennart Poettering2021-02-181-8/+19
| | | | | | | (physical_memory|system_tasks)_max_scale() Also, shortcut two special cases for passing through values as-is, so that we are not needlessly subjected to overflow issues for them.
* update TODOLennart Poettering2021-02-181-0/+12
|
* network: rename UseFQDN= -> UseHostname=Yu Watanabe2021-02-186-12/+7
| | | | | Prompted by https://github.com/systemd/systemd/pull/18543#issuecomment-780798451.
* Merge pull request #18685 from poettering/network-type-tweaksLennart Poettering2021-02-1825-71/+71
|\ | | | | sd-network.h type tweaks
| * network: tighten table alignment a bitLennart Poettering2021-02-181-17/+17
| |
| * network: suffix types with _t in public headersLennart Poettering2021-02-1825-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | Apparently, in our current public headers (i.e. those called sd-*.h) we suffixed typedefs that we use as values with _t, but we didn't do this for enum typedefs. Fix that while this stuff is not actually public yet. With this scheme "value typedefs" now end systematically in _t, and "object typedefs" (i.e. structures that are typically passed around via pointers and not values) do not. No code changes, just some renaming.
* | random-util: fix type of random_u64_range()Lennart Poettering2021-02-182-2/+2
| | | | | | | | | | | | As the name of the function suggests this is supposed to return uint64_t, of course. Fix it. Not sure how this mistake happened in the first place...
* | Merge pull request #18546 from poettering/sd-device-actionLennart Poettering2021-02-1827-146/+156
|\ \ | | | | | | export sd_device_get_action() API + more
| * | udevadm: after validating action, use our internal string instead of optargLennart Poettering2021-02-182-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | This doesn't really change anything, but feels nicer, since it abstracts away what device_action_from_string()/device_action_to_string() do internally, and always uses a normalized action string (yes, there's no ambiguity, but it's nice to stay abstract, maybe one day there is ambiguity around this)
| * | sd-device: add sd_device_get_action() + sd_device_get_seqnum() + ↵Lennart Poettering2021-02-1827-139/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sd_device_new_from_stat_rdev() To make sd-device properly usable for all programs we need to provide an API for the "action" field of an event, it's one of the most relevant ones, and it was so far missing. This also adds sd_device_get_seqnum(), which isn't that interesting, except for generating pretty debug output, which we use it ourselves for. This also makes device_new_from_stat_rdev() public, as it is truly useful, as we can see in our own uses of it, and I think is fairly generic to show up in the public APIs.
| * | sd-device: don't compare pointers with numeric zeroLennart Poettering2021-02-181-3/+8
| | | | | | | | | | | | Our coding style says no to this.
* | | https://github.com/systemd/systemd/issues/15360chri22021-02-181-11/+23
| | | | | | | | | | | | | | | | | | The additional rules fix a firmware bug in the en keyboard of Librem notebooks by Purism. By doing so the break the keyboard with other layouts which do not have the same bug in their firmware.
* | | resolved: improve debug logging on incoming messages a bitLennart Poettering2021-02-182-3/+7
| | |
* | | Merge pull request #18679 from keszybz/rfkill-size-leniencyZbigniew Jędrzejewski-Szmek2021-02-181-38/+41
|\ \ \ | | | | | | | | struct rfkill_event read/write size leniency
| * | | rfkill: use short writes and accept long readsZbigniew Jędrzejewski-Szmek2021-02-181-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm seeing the following with kernel-core-5.10.16-200.fc33.x86_64: $ sudo SYSTEMD_LOG_LEVEL=debug build/systemd-rfkill Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 0 and type bluetooth. Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy Found container virtualization none. rfkill0: Operating on rfkill device 'tpacpi_bluetooth_sw'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:bluetooth. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 1 and type wwan. rfkill1: Operating on rfkill device 'tpacpi_wwan_sw'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:wwan. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 2 and type bluetooth. rfkill2: Operating on rfkill device 'hci0'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:7:1.0:bluetooth. Reading struct rfkill_event: got 8 bytes. A new rfkill device has been added with index 3 and type wlan. rfkill3: Operating on rfkill device 'phy0'. Writing struct rfkill_event successful (8 of 9 bytes). Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:04:00.0:wlan. All events read and idle, exiting. We were expecting a read of exactly RFKILL_EVENT_SIZE_V1==8 bytes. But the structure has 9 after [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=14486c82612a177cb910980c70ba900827ca0894 For some reason the kernel does not accept the full structure size, but cuts the write short after 8 bytes: static ssize_t rfkill_fop_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { struct rfkill_event ev; /* we don't need the 'hard' variable but accept it */ if (count < RFKILL_EVENT_SIZE_V1 - 1) return -EINVAL; /* * Copy as much data as we can accept into our 'ev' buffer, * but tell userspace how much we've copied so it can determine * our API version even in a write() call, if it cares. */ count = min(count, sizeof(ev)); if (copy_from_user(&ev, buf, count)) return -EFAULT; ... so it should accept the full size. I'm not sure what is going on here. But we don't care about the extra fields, so let's accept a write as long as it's at least RFKILL_EVENT_SIZE_V1. Fixes #18677.
| * | | rfkill: improve error loggingZbigniew Jędrzejewski-Szmek2021-02-181-36/+30
| | | | | | | | | | | | | | | | If we get something of unexpected size, log the sizes. Also, don't log twice.
* | | | journald: when we fail to add a new entry to a journal, return the seqnoLennart Poettering2021-02-181-14/+46
| | | | | | | | | | | | | | | | Fixes: #18005
* | | | Merge pull request #18664 from poettering/resolved-defragLennart Poettering2021-02-1811-52/+300
|\ \ \ \ | |_|/ / |/| | | resolved: many UDP fragmentation tweaks
| * | | resolved: take fragment size into consideration when determining EDNS0 udp ↵Lennart Poettering2021-02-182-3/+51
| | | | | | | | | | | | | | | | packet size
| * | | resolved: let's track fragment sizes of servers/retry on fragmentingLennart Poettering2021-02-185-14/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fragmenting sucks, let's avoid it. Thus let's start tracking the maximum fragment size we receive. Also, let's redo a transaction via TCP if we see fragmenting on UDP, as effective mitigation against DNS fragment attacks.
| * | | resolved: tweak how we calculate MTU for sending packetsLennart Poettering2021-02-184-29/+59
| | | | | | | | | | | | | | | | | | | | | | | | Let's take all MTU info we possibly have into account, i.e. the one reported via netlink, as before and the one the socket might now (from PMTUD and such), clamped by our own ideas.
| * | | resolved: add udp_header_size() helperLennart Poettering2021-02-182-6/+24
| | | |
| * | | resolved: collect incoming fragment size when receiving UDP datagramsLennart Poettering2021-02-184-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | We can later use this to adapt our announced EDNS buffer size in order to avoid fragmentation to make the best of large datagrams while still avoiding he security weaknesses of it.
| * | | resolved: disable path MTU discovery for UDP trafficLennart Poettering2021-02-184-0/+73
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | This disables path MTU discovery both for our UDP upstream connections and our UDP stub, following the suggestions of: https://blog.apnic.net/2019/07/12/its-time-to-consider-avoiding-ip-fragmentation-in-the-dns/ This more or less follows the model of other DNS servers on this.
* | | Merge pull request #18667 from poettering/resolved-change-notificationLennart Poettering2021-02-188-53/+189
|\ \ \ | |/ / |/| | resolved: optimize dbus change notification signals a bit
| * | resolved: optimize change notification handling away if bus calls set the ↵Lennart Poettering2021-02-185-53/+82
| | | | | | | | | | | | | | | | | | | | | same values as were already set Prompted-by: #17577 (but doesn't fix this, since this commit only handles D-Bus-induced changes, not the ones made via networkd)
| * | basic: add set_equal() helperLennart Poettering2021-02-183-0/+107
|/ /
* | man: Rename duplicate Credentials section nameДамјан Георгиевски2021-02-181-1/+1
| | | | | | | | | | | | | | A "Credentials" section name in systemd.exec man page was used both for User/Group and for actual credentials support in systemd. Rename the first instance to "User/Group Identity"
* | networkd-test: reenable dnssec while testingLennart Poettering2021-02-181-9/+17
| | | | | | | | | | | | | | We need to list the synthesized domains as NTAs, otherwise the DNSSEC validation of course cannot succeed. Fixes: #10487 #5029
* | Merge pull request #18557 from poettering/enum-force-s64Zbigniew Jędrzejewski-Szmek2021-02-188-40/+54
|\ \ | | | | | | force public enums to be 64bit wide
| * | network: make use of SD_ENUM_FORCE_S64() for all public enumsLennart Poettering2021-02-166-3/+16
| | |
| * | sd-common: add new macro for forcing 64bit size for public enumsLennart Poettering2021-02-161-0/+6
| | | | | | | | | | | | | | | That's the only way we can retain type-safe enums while being able to guarantee for stable enum sizes.
| * | test-tables: make sure we can test tables of either int or int64_t base typeLennart Poettering2021-02-161-37/+32
| | | | | | | | | | | | | | | To support both types, we unfortunately need to go down the macro rabbit hole a bit more. But it works.
* | | network: Add "route_localnet" sysctl supportSusant Sahani2021-02-186-0/+26
| | |
* | | Merge pull request #18665 from poettering/resolved-fastopenZbigniew Jędrzejewski-Szmek2021-02-182-39/+94
|\ \ \ | | | | | | | | resolved: use TCP FASTOPEN on the local DNS stub
| * | | resolved: also use TCP tweaks on LLMNR (plus unify setsockopt() code)Lennart Poettering2021-02-171-39/+65
| | | |
| * | | resolved: enable TCP_FASTOPEN + TCP_NODELAY on stub TCP socketLennart Poettering2021-02-171-0/+29
| | | | | | | | | | | | | | | | | | | | Latency matters. Four our local DNS stub it's not really that important, but let's still do it, it's basically free after all.
* | | | Merge pull request #18625 from bluca/sysext_refactorLuca Boccassi2021-02-1811-117/+324
|\ \ \ \ | |_|_|/ |/| | | dissect: parse and store extension-release metadata
| * | | env-util: refactor parsing helper for SYSTEMD_SYSEXT_HIERARCHIES out of sysextLuca Boccassi2021-02-173-42/+52
| | | |
| * | | os-util: allow missing VERSION_ID on the hostLuca Boccassi2021-02-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Rolling releases, like ArchLinux, do not set VERSION_ID in their os-release files, so allow matching simply on ID if the host does not provide anything.
| * | | os-util: split extension_release_validate out of sysextLuca Boccassi2021-02-173-53/+109
| | | |
| * | | machine: parse and store extension-releaseLuca Boccassi2021-02-172-1/+9
| | | | | | | | | | | | | | | | | | | | Follow the same pattern as os-release parsing, and store the key-value pairs in a strv if found
| * | | dissect: parse, store and show extension-release infoLuca Boccassi2021-02-173-15/+69
| | | |
| * | | dissect: store image name, following usual parsing rulesLuca Boccassi2021-02-172-1/+32
| | | | | | | | | | | | | | | | The name of '/foo/bar/baz.raw' name is 'baz'
| * | | env-util: add strv_env_pairs_get helperLuca Boccassi2021-02-173-0/+25
| | | |
| * | | os-util: add load_extension_release_pairs helperLuca Boccassi2021-02-172-0/+13
| | | |
| * | | os-util: add path_is_extension_tree helperLuca Boccassi2021-02-172-5/+10
| |/ /