Commit Graph

55074 Commits

Author SHA1 Message Date
Yu Watanabe
d9910948eb network: do not reconfigure wireless interface when previously not connected to any APs
Follow-up for 6706ce2fd2.

Fixes #21685.
2021-12-09 03:04:24 +09:00
Yu Watanabe
da94e4ddf5 network: wifi: ssid may be NULL
This fixes the following log message:
systemd-networkd[888]: wlan0: nl80211: received new_interface(7) message: iftype=station, ssid=(null)
2021-12-09 02:43:29 +09:00
Luca Boccassi
c65a0cf62f Merge pull request #21667 from yuwata/resolve-do-not-re-read-settings-from-networkd-when-unmodified
resolve: do not re-read settings from networkd when link state file is unmodified
2021-12-08 13:28:15 +00:00
Daan De Meyer
ecfa85e9e1 docs: Clarify that the fd store is discarded when a service is stopped 2021-12-08 13:27:28 +00:00
Frantisek Sumsal
52e4ac691e Merge pull request #21676 from keszybz/rename-variables-to-make-codeql-happy
Rename variables to make codeql happy
2021-12-08 13:24:17 +00:00
наб
a96fc72dbf journal: succes[s]fully typo
As found by fossies codespell:
https://fossies.org/linux/test/systemd-main.bb916f3.211208.tar.gz/codespell.html
2021-12-08 13:23:56 +00:00
Frantisek Sumsal
efea45f19c ci: ignore FIXME alerts in the CodeQL Action
We already track them in LGTM and it unnecessarily clutters the Security
page.
2021-12-08 12:42:28 +00:00
Yu Watanabe
bb916f350a network: call link_check_ready() when all stacked netdevs are created
Follow-up for 879377cad5.

Otherwise, the underlying interface may stuck in configuring state.
2021-12-08 18:40:13 +09:00
Yu Watanabe
214db8eb5d resolve: do not re-read settings from networkd if link state file is unmodified
If many interface creation/deletion occurs continuously, then resolved
becomes easily busy. Let's slightly optimize the event triggered by
sd-network.
2021-12-08 18:34:08 +09:00
Yu Watanabe
8e0bacab6e sd-network: introduce sd_network_link_get_stat() 2021-12-08 18:34:04 +09:00
Yu Watanabe
f4af5f0010 sd-network: drop unnecessary +1 for buffer size 2021-12-08 18:33:35 +09:00
Daan De Meyer
9872fe44cb Merge pull request #21527 from vcaputo/journal-file-mfd-centric
journal-file: get rid of JournalFile.mmap
2021-12-08 09:26:53 +00:00
Zbigniew Jędrzejewski-Szmek
874e525de4 test-dhcp-option: inline iterator variable declarations 2021-12-08 10:13:50 +01:00
Zbigniew Jędrzejewski-Szmek
1a735f9b22 test-exec-util: rename variable to avoid global/local name conflict 2021-12-08 10:13:50 +01:00
Zbigniew Jędrzejewski-Szmek
74e2e54896 test-dhcp-option: rename variable to avoid global/local name conflict
CodeQL was complaining that the local variable obscurs the global
one. It is indeed a bit confusing when reading this… Let's rename
the variable to avoid confusing the reader.
2021-12-08 10:13:44 +01:00
наб
dcd9d196a4 kernel-install: respect $MACHINE_ID and ignore /etc/machine-id if on tmpfs
Confer https://github.com/systemd/systemd/pull/19006#issuecomment-800234022:
  On some systems it's the admin's explicit choice not to to have the
  machine ID leak into the ESP
  On some systems the machine ID is transient, generated at every boot,
  and hence should not be written to the ESP
2021-12-08 09:34:02 +01:00
Yu Watanabe
733caba389 Merge pull request #21672 from yuwata/network-old-kernel-support
network: old kernel support
2021-12-08 10:11:20 +09:00
Zbigniew Jędrzejewski-Szmek
e7bd34cd64 meson: drop libgcrypt dep from resolved tests
Follow-up for pull request #21170.

I hoped that we would drop libgcrypt fully and drop all references to the
library in meson, but this doesn't seem feasible (because of the use in
sd-journal). But let's remove it here, all the resolved code has been switched
to work either of the two libraries.
2021-12-08 01:00:56 +00:00
Yu Watanabe
990d0aa980 dhcp: fix assertion failure
Fixes #21671.
2021-12-08 08:52:33 +09:00
Vito Caputo
74fb5be62d journal-file: require MMapCache* for journal_file_open()
Previously the MMapCache* was optionally NULL, which open would
handle by creating a new MMapCache* for the occasion.

This produced some slightly circuitous refcount-handling code in
the function, as well as arguably creating opportunities for
weirdness where an MMapCache* was intended to be supplied but
happened to be NULL, which this magic would then paper over.

In any case, this was basically only being utilized by tests,
apparently just to avoid having to create an MMapCache.  So
update the relevant tests to supply an MMapCache and make
journal_file_open() treat a NULL MMapCache* as fatal w/assert.
2021-12-07 14:39:20 -08:00
Vito Caputo
333d067262 mmap-cache: add MMapCache trivial cleanup helpers
Enable _cleanup_(mmap_cache_unrefp) style cleanup for MMapCache*
2021-12-07 14:16:28 -08:00
Vito Caputo
a8da63309c journal-file: goodbye JournalFile.mmap
This gets rid of the manual MMapCache ref/unref goop in
journal_file_{open,close}(), in favor of just letting the
JournalFile.cache_fd MMapFileDescriptor carry the baton.
2021-12-07 13:03:34 -08:00
Vito Caputo
8b4fbbb0a1 journal: stop using JournalFile.mmap everywhere
Preparatory commit; before JournalFile can stop hanging onto its
copy of MMapCache, all these users need to find another way.

Most of the time these callers already have the MMapCache onhand,
so it's no big deal for them to just supply it.

journal_file_rotate() in particular needed to change, and it
seemed wise to not use the mmap_cache_fd_cache() accessor on
f->cache_fd, instead requiring the caller supply the cache to
use.  This was done with an eye towards a potential future where
the journal_file_archive() isolates the cache_fd to a private
cache, which the newly rotated-to file wouldn't be allowed to
use.  It's no biggie for the existing callers to just provide the
appropriate surviving cache.

Basically the mmap_cache_fd_cache() accessor was added just for
journal-verify.c's (ab)use of the mmap-cache.  Which, if the
ugly singleton MMapCache assumption ever goes away, can be
cleaned up to simply use a separate MMapCache for those search
arrays.
2021-12-07 13:00:25 -08:00
Vito Caputo
176bf8b827 mmap-cache: add MMapFileDescriptor.cache accessor
Sometimes we want to reuse an existing MMapFileDescriptor's
cache, but it's a private struct.

This lets us access that pointer if necessary.
2021-12-07 12:42:19 -08:00
Vito Caputo
fd9ac6c307 mmap-cache: ref/unref MMapCache in fd add/free
Preparatory commit; callers manually ref/unref MMapCaches
alongside MMapFileDescriptor add/frees, when the latter should be
sufficient.

A subsequent commit will drop some of those manual MMapCache
reference hoop-jumping, leaving the lifecycle bound to
MMapFileDescriptors.
2021-12-07 12:42:19 -08:00