| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This way we can take benefit of the fact that physical_memory_scale()
aligns on page sizes.
|
|
|
|
|
|
| |
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 ‱.
|
|
|
|
|
|
|
| |
(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.
|
| |
|
|
|
|
|
| |
Prompted by
https://github.com/systemd/systemd/pull/18543#issuecomment-780798451.
|
|\
| |
| | |
sd-network.h type tweaks
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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...
|
|\ \
| | |
| | | |
export sd_device_get_action() API + more
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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_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.
|
| | |
| | |
| | |
| | | |
Our coding style says no to this.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
|\ \ \
| | | |
| | | | |
struct rfkill_event read/write size leniency
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | | |
If we get something of unexpected size, log the sizes. Also, don't log twice.
|
| | | |
| | | |
| | | |
| | | | |
Fixes: #18005
|
|\ \ \ \
| |_|/ /
|/| | | |
resolved: many UDP fragmentation tweaks
|
| | | |
| | | |
| | | |
| | | | |
packet size
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| | |
resolved: optimize dbus change notification signals a bit
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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)
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
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"
|
| |
| |
| |
| |
| |
| |
| | |
We need to list the synthesized domains as NTAs, otherwise the DNSSEC
validation of course cannot succeed.
Fixes: #10487 #5029
|
|\ \
| | |
| | | |
force public enums to be 64bit wide
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
That's the only way we can retain type-safe enums while being able to
guarantee for stable enum sizes.
|
| | |
| | |
| | |
| | |
| | | |
To support both types, we unfortunately need to go down the macro rabbit
hole a bit more. But it works.
|
| | | |
|
|\ \ \
| | | |
| | | | |
resolved: use TCP FASTOPEN on the local DNS stub
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| |_|_|/
|/| | | |
dissect: parse and store extension-release metadata
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Follow the same pattern as os-release parsing, and store the key-value
pairs in a strv if found
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
The name of '/foo/bar/baz.raw' name is 'baz'
|
| | | | |
|
| | | | |
|
| |/ / |
|