Commit Graph
86332 Commits
Author SHA1 Message Date
r-vdp e271497d97 dns-delegates: add support for setting a firewall mark
This makes it possible to have DNS requests for certain domains routed
differently than normal requests, which is for instance useful when
using policy routing to route traffic over a VPN but DNS requests for
the VPN endpoint itself, should be routed differently.

It doesn't make much sense to configure a firewall mark at the level of
a network interface, but at the level of a DNS delegate it can be very
useful.
2026-02-16 11:09:48 +01:00
Daan De Meyer a5ceab95ab Varlink fixlets and several other follow-ups (#40687) 2026-02-16 11:02:08 +01:00
Daan De Meyer d1e0b59843 oomd: Fix bug where we drop queued kill state on duplicate cgroup (#40690) 2026-02-16 10:52:49 +01:00
Zbigniew Jędrzejewski-Szmek dae5af119b timesync: fix parsing FallbackNTP= (#40692)
Follow-up for 3745770ae4.
Fixes #40621.
2026-02-16 10:16:21 +01:00
Mike Yuan 389cd296ec core: serialize metrics varlink server as well 2026-02-16 09:44:58 +01:00
Mike Yuan 5561623ef4 core/manager-serialize: discern daemon-reload/reexec via objective 2026-02-16 09:44:58 +01:00
Mike Yuan b166461f82 varlink-serialize: deserialize to correct event priority 2026-02-16 09:44:58 +01:00
Mike Yuan 9676845efa core/varlink: several cleanups for metrics varlink server
Follow-up for bb1ef2edf7

The commit introduced a new "metrics" varlink server, but for
user scope stuff it is not bound anywhere. The copy-pasted
"fresh" handling for deserialization is also essentially
meaningless as metrics_setup_varlink_server() doesn't even report
whether the varlink server is fresh (let alone that no serialization
is being done at all right now). Moreover, currently the event
priority is hardcoded, while event loop and associated priority
assignment ought to be subject to each daemon.

While fixing the mentioned issues I took the chance to restructure
the existing code a bit for readability. Note that serialization
for the metrics server is still missing - it will be tackled
in subsequent commits.
2026-02-16 09:44:58 +01:00
Yu Watanabe ba08fa3230 shared/metrics: add two more assertions 2026-02-16 09:44:58 +01:00
Mike Yuan 702db03034 shared/metrics: name the sd_varlink_server in our usual fashion
This is used for internal reference, in debug logging and such,
hence let's do nothing fancy but instead make it identifiable.
2026-02-16 09:44:57 +01:00
Mike Yuan ba5bd88db3 core/varlink-metrics: suffix metrics methods with _metrics
This is not even the prominent "Describe" method in pid1,
as typically one would be looking for _describe_manager().
2026-02-16 09:44:57 +01:00
Mike Yuan 3cfd35eef9 core/varlink-metrics: include core-forward.h 2026-02-16 09:44:57 +01:00
Mike Yuan fe48347ce6 core/varlink-cgroup: add BindNetworkInterface to varlink CGContext
Follow-up for c1c787651b
2026-02-16 09:44:57 +01:00
Mike Yuan eeead6e177 sd-varlink: fail if a method call wasn't replied to and the callback didn't store it 2026-02-16 09:44:56 +01:00
Mike Yuan 1f9ba6ba73 sd-varlink: take output queue into account in sd_varlink_flush() 2026-02-16 09:44:56 +01:00
Mike Yuan 86ac1083c9 sd-varlink: _reset_fds() should reset fds for the reply being constructed
... (aka pushed_fds), not what's already enqueued to be sent out.
2026-02-16 09:44:56 +01:00
Mike Yuan 959f6923e5 sd-varlink: use free_and_replace at one more place 2026-02-16 09:44:56 +01:00
Mike Yuan 9257690859 sd-varlink: replace manual move_fd() with FORK_PACK_FDS + FORK_CLOEXEC_OFF
Note that this actually matters: we might otherwise clobber
the logging fds reopened when rearranging fd '3'.

While at it, avoid logging from library functions.
2026-02-16 09:44:56 +01:00
Mike Yuan 122bde2c45 sd-varlink: also validate peer ucred for SD_VARLINK_SERVER_MYSELF_ONLY 2026-02-16 09:44:55 +01:00
Mike Yuan 3482e4dd70 sd-varlink: log about client uid that hit connection limit 2026-02-16 09:44:55 +01:00
Mike Yuan e2fb041564 sd-varlink: shorten the code a bit 2026-02-16 09:44:55 +01:00
Mike Yuan 097243cc30 repart: io.systemd.Repart.ListCandidateDevices requires 'more' 2026-02-16 09:44:55 +01:00
Mike Yuan 03023fd12c resolve: io.systemd.Resolve.BrowseServices requires 'more' 2026-02-16 09:44:55 +01:00
Mike Yuan 41e675996d mute-console: io.systemd.MuteConsole requires 'more' 2026-02-16 09:44:54 +01:00
Mike Yuan 09388a6b9e tree-wide: drop redundant check for SD_VARLINK_METHOD_MORE flag
If the IDL declares the method requires 'more' yet the call doesn't
have it set, varlink_idl_validate_method_call() should have rejected
it and the callback shouldn't be reached.
2026-02-16 09:44:54 +01:00
Mike Yuan 42ed373294 varlink-io.systemd.Network: minor coding style cleanups
Follow-up for cf27c70d70
2026-02-16 09:44:54 +01:00
Mike Yuan 05d1cfee90 sd-json: unify JSON_BUILD_PAIR_IN?_ADDR_*
This also swaps family and address params for
plain JSON_BUILD(_PAIR)_IN_ADDR, aligning with
_WITH_STRING flavors.
2026-02-16 09:44:54 +01:00
Mike Yuan 926ae62a27 json-util: sort includes 2026-02-16 09:44:53 +01:00
Mike Yuan daeb7dd390 sd-json: use FOREACH_ARRAY more 2026-02-16 09:44:53 +01:00
Mike Yuan 89769fb4ad shared: conditionalize build of apparmor-util.c in meson 2026-02-16 09:44:53 +01:00
Mike Yuan 3ac675dff3 process-util: drop unused TAKE_PID
Follow-up for fbd276cb86

We now track helper processes via PidRef throughout the codebase.
2026-02-16 09:44:53 +01:00
Mike Yuan 36f82366d0 process-util: group oom_score_adjust_is_valid() with getter/setter 2026-02-16 09:44:53 +01:00
Mike Yuan 763f615c3a log-context: drop redundant forward decl
We consolidated all these into forward.h.
2026-02-16 09:44:52 +01:00
Mike Yuan e0fb180483 backlight: update comment to match the new clamp value
Follow-up for 4ed1e2ea17
2026-02-16 09:44:52 +01:00
Daan De Meyer 77b3ddf2aa mkosi: Install musl in tools trees on Fedora/Arch
For debugging purposes.
2026-02-16 09:37:14 +01:00
Lennart Poettering e1ecec0274 update TODO 2026-02-16 09:06:03 +01:00
Yu Watanabe 618952f07e CODING_STYLE: fix typo
Follow-up for 83b4a5bb3d.
2026-02-16 14:35:21 +09:00
Yu Watanabe 06dca3f629 man: fix typo
Follow-up for 91b3620b07.
2026-02-16 14:34:04 +09:00
Yu Watanabe c33b112cac sd-varlink: fix typo
Follow-up for c0696f1f5d.
2026-02-16 14:32:15 +09:00
Yu Watanabe 5ac9a481cd network: fix typo
Follow-up for f8a4c3d375.
2026-02-16 14:30:38 +09:00
Yu Watanabe 3be36e6d64 NEWS: fix typo
Follow-up for 4ed1e2ea17.
2026-02-16 14:28:55 +09:00
gvenugo3andYu Watanabe 2291cf0626 network: implement varlink LinkUp and LinkDown methods
The new varlink methods are basically equivalent to 'ip link set INTERFACE up/down',
but they support polkit authentication. Also, on LinkDown, it gracefully
stops dynamic engines like DHCP client/server before the interface is
bring down. Hence, e.g. an empty RA on stop should be sent.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2026-02-16 14:28:52 +09:00
Yu Watanabe a48145203c network: use voffsetof() at more places 2026-02-16 14:28:52 +09:00
Yu Watanabe 345208a49b udev: guess if usb devices are internal external (#40649)
Actually we are defining databases to determine when a usb device is
inherent part of the system or if it's a external device.

Let's use the removable attribute of the port where it is connected to
say that. That gives us the ability to not rely on a particular vendor
only does external devices or to not having the need to be quirking
input subsystem for that purpose that will become unreliable as more and
more internal devices are connected over usb instead over ps2 or i2c
buses. Eg.
https://gitlab.freedesktop.org/libinput/libinput/-/commit/02b495e79022e64514015e1a3dea32997035dd4f?merge_request_iid=1389

Actually this has been seen as reliable in a small set of device from
normal laptops, to detachable ones. The need to check maxchild is 0 is
for detachable devices, pogo pin usbs are fixed, while we attach the
keyboard|touchpad dock the input devices tend to be directly connected
to that port and if the dock has more usbs tend to be a hub that then
exposes removable as unknow. If we don't set maxchild 0 we will not only
guess that the keyboard and touchpad are internal but also incorrectly
other input devices like mice connected to the dock's usb ports.

I have use a very generic name like INTEGRATION because is not actually
used for any other thing and is used to determine not only over usb bus
but for acpi, pci, platform actually.

Also a remap to actual libinput variables is done for compatibility
purposes. if it's possible to have only the INTEGRATION variable instead
multiple ones will be done in the future but is actually unclear.

This can also be used for example to achieve an actual feature that we
lack in linux, when a device with accelerometers and cameras is rotated
the video output is not, this tag the own device cameras as internal
while external ones as external to be able to only do that for the
internal ones.

Note that this has nothing to do with the removable attribute found in
usb storage devices where it's values can be 0 or 1. There is no
conflict at all because the removable attribute we check is specifically
the one found in usb port ones.
2026-02-16 13:25:35 +09:00
Oleksandr AndrushchenkoandYu Watanabe f8a4c3d375 network: add ModemManager support
[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2026-02-16 13:22:21 +09:00
David Santamaría Rogado 4ed1e2ea17 backlight: reduce clamp to 1%
Actually GNOME sets a clamp of 1% and divides in 20 steps the brightness
control. Using 5% clamp makes things like in a device with max value 640
to always be in the first brightness step in GNOME and we can't leave in
the minimum.

GNOME set steps of 640/20 = 32 with the zero step 640 * 1% = 6. When we
restart the device with the lowest bright systemd sees 6 but sets
640 * 5% = 32, so we get the brightness in the first step.

Tests in IPS and OLED panels have been done and 1% still seems a
comprensive minimun usable value so use that to allow all environments
to be able to set lower brightness values that won't be raised by
systemd at boot.

If your user enviroment allow to set excesive lower unusable values you
should blame it or yourself if you directle changes it through sysfs but
not systemd.
2026-02-16 13:20:55 +09:00
David Santamaría Rogado a4381cae8b udev: rules: guess devices if internal or external
Set ID_INTEGRATION variable to hint if a device is internal (inherent
part of the system) or external otherwise.
2026-02-16 03:46:25 +01:00
David Santamaría Rogado babfd9cbaa hwdb: don't error on empty hwdb file 2026-02-16 03:39:08 +01:00
Yu Watanabe 1b1799e9ba timesync: actually disables built-in fallback NTP servers when an empty string is specified
Follow-up for 3745770ae4.
Fixes #40621.
2026-02-16 09:53:03 +09:00
Yu Watanabe b0ca2ef264 timesync: return earlier when an empty string is specified 2026-02-16 09:51:36 +09:00