summaryrefslogtreecommitdiffstats
path: root/src/network/wait-online (follow)
Commit message (Collapse)AuthorAgeFilesLines
* signal-util: imply sentinel -1 in sigprocmask_many() + sigset_add_many() ↵Lennart Poettering2024-02-231-1/+1
| | | | args list
* wait-online: split out get_state_range()Yu Watanabe2024-02-081-9/+23
| | | | | | | Follow-up for 2d708781620239c9d1f9828a39f8761acf6350b2. After the conversion from FOREACH_POINTER() to FOREACH_ARGUMENT(), the iterator is never set to POINTER_MAX.
* wait-online: by default not all interface need to be onlineYu Watanabe2024-02-061-1/+3
| | | | | | | | | Fixes an issue caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d (v253). By default, all managed interface need to be configured, and at least one interface need to be online. Hence, offline interface should be ignored. Fixes #29506.
* tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENTMike Yuan2024-01-241-1/+1
| | | | | The latter is more generic and while being compatible with the former.
* wait-online: several cleanups for LinkOperationalStateYu Watanabe2024-01-162-31/+21
| | | | | | | - fix memleak in parser, - fix missing return in parser on failure, - drop unnecessary temporary argument in command line argument parser, - use recently introduced macros and helper functions.
* wait-online: request that at least one managed online interface existsYu Watanabe2023-05-311-7/+15
| | | | | | | | | | Fixes a regression caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d. I thought the commit does not cause any severe regression. However, drivers for network interfaces may be loaded later. So, we should wait if no network interface is found. Fixes #27822.
* wait-online: downgrade log level of failure that interface is removed or ↵Yu Watanabe2023-05-221-4/+6
| | | | | | unmanaged during processing it Closing #27145.
* wait-online: exit with success when all interfaces are ready or unmanagedYu Watanabe2022-12-221-57/+50
| | | | | | | | | | | | | | | | | Previously, when neither '--any' nor '--interface' options specified, at least one of the interfaces must be in configured state. This patch makes wait-online exit with success even if all interfaces are in unmanaged state. This may break backward compatibility in a rare situation. But in most cases, this typically not change anything, as at least one interface is managed by networkd.service when it is enabled. This is mostly for making wait-online gracefully handle the case that networkd.service and wait-online.service are enabled by mistake. In such situation, all interfaces are typically not managed. Fixes #25813.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+0
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-0/+1
|
* wait-online: support alternative namesYu Watanabe2022-11-013-4/+68
|
* wait-online: check received interface nameYu Watanabe2022-11-011-0/+13
|
* wait-online: split out link_update_name()Yu Watanabe2022-11-011-14/+30
| | | | | No functional changes, just refactoring and preparation for later commits.
* wait-online: ignore one more error in callback functionYu Watanabe2022-11-011-3/+5
|
* wait-online: ignore -ENODATA from sd_network_link_get_required_for_online()Yu Watanabe2022-10-271-6/+7
| | | | | | | Follow-up for 778e3da95ef16302956087e6f10ccf7d42499aec. These settings are saved only when a .network file is assigned to the interface. Let's silence noisy logs for unmanaged interfaces.
* sd-network: drop fallback valuesYu Watanabe2022-09-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This drops spurious lines in `networkctl status` for unmanaged interfaces. Before: ``` $ networkctl status --lines 0 lo ● 1: lo Link File: n/a Network File: n/a Type: loopback State: carrier (unmanaged) Online state: unknown HW Address: 00:00:00:00:00:00 MTU: 65536 QDisc: noqueue IPv6 Address Generation Mode: eui64 Queue Length (Tx/Rx): 1/1 Address: 127.0.0.1 ::1 Activation Policy: up Required For Online: yes ``` After: ``` $ networkctl status --lines 0 lo ● 1: lo Link File: n/a Network File: n/a State: carrier (unmanaged) Online state: unknown Type: loopback Hardware Address: 00:00:00:00:00:00 MTU: 65536 QDisc: noqueue IPv6 Address Generation Mode: eui64 Number of Queues (Tx/Rx): 1/1 Address: 127.0.0.1 ::1 ``` That is, the lines for Activation Policy and Required For Online are dropped.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-5/+2
|
* sd-netlink: rename sd_netlink_message_request_dump to ↵Zbigniew Jędrzejewski-Szmek2022-08-191-1/+1
| | | | sd_netlink_message_set_request_dump
* time-util: assume CLOCK_BOOTTIME always existsLennart Poettering2022-03-281-1/+1
| | | | | | | | Let's raise our supported baseline a bit: CLOCK_BOOTTIME started to work with timerfd in kernel 3.15 (i.e. back in 2014), let's require support for it now. This will raise our baseline only modestly from 3.13 → 3.15.
* network: s/confiured/configured/Frantisek Sumsal2022-02-011-1/+1
| | | | A quick typo fix I noticed whilst debugging.
* wait-online: make manager_link_is_online() return 0 when in unmanaged stateYu Watanabe2022-01-261-4/+21
| | | | | | | | | | | | | | Previously, even if a link is in unmanaged state, the function may returns positive value. So, even if all managed links are in the configured sate but do not satisfy the online criteria, e.g., IPv4 address state, then wait-online finishes with positive value. This makes the function always return 0 for unmanaged state. So, at least one managed link must satisfies the online criteria. This also adds more comments and debugging logs. Fixes #22246.
* wait-online: rename Manager elementsYu Watanabe2022-01-263-20/+25
|
* wait-online: use network_link_get_operational_state()Yu Watanabe2022-01-201-11/+2
|
* wait-online: also use address state even when operational state is below ↵Yu Watanabe2021-12-141-4/+2
| | | | | | degraded Closes #21706.
* tree-wide: mark set-but-not-used variables as unused to make LLVM happyFrantisek Sumsal2021-09-151-1/+1
| | | | | | | | | | | | | | LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which trips over some intentionally set-but-not-used variables or variables attached to cleanup handlers with side effects (`_cleanup_umask_`, `_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.): ``` ../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable] _cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL; ^ 1 error generated. ```
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* wait-online: fix typoYu Watanabe2021-07-071-1/+1
|
* wait-online: improve timeout log messageLennart Poettering2021-07-021-0/+2
| | | | | | | | | | | | The time-out when waiting to reach the online state is a pretty regularly seen error, let's print an explicit log message for it. The previous "Event loop failed: timed out" message is a bit too low-level I think for regular users (as event loops are a developer's concept, not a user's, really). Note that outputting low-level error messages is generally actually OK I think — for unexpected errors, but this timeout is a pretty expected one, directly configurable by the user, hence output something friendly.
* Merge pull request #19315 from ↵Luca Boccassi2021-04-141-16/+16
|\ | | | | | | | | yuwata/network-wait-online-address-family-follow-ups network: several follow-ups for #19069
| * wait-online: update debug log messagesYu Watanabe2021-04-141-16/+16
| |
* | Merge pull request #19302 from bluca/uninitZbigniew Jędrzejewski-Szmek2021-04-141-1/+1
|\ \ | |/ |/| tree-wide: avoid uninitialized warning on _cleanup_ variables
| * tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-141-1/+1
| | | | | | | | | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* | wait-online: wait for address familyLetzteInstanz2021-04-145-3/+101
|/ | | | This introduce -4 and -6 commandline options.
* network-wait-online: use sd_event_add_time_relative()Zbigniew Jędrzejewski-Szmek2021-03-051-6/+2
|
* tree-wide: use usec_add() and usec_sub_unsigned()Yu Watanabe2021-03-041-1/+1
|
* tree-wide: return NULL from freeing functionsZbigniew Jędrzejewski-Szmek2021-02-162-7/+4
| | | | | | I started working on this because I wanted to change how DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's nice to make make things more consistent and predictable.
* tree-wide: propagate error code from _from_string() functionsZbigniew Jędrzejewski-Szmek2021-02-101-2/+1
| | | | Now that we know we have something useful, no need to make an answer up.
* tree-wide: enable colorized logging for daemons when run in consoleYu Watanabe2021-01-311-1/+1
| | | | It may be useful when debugging daemons.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-4/+3
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* network: wait-online - add a assertSusant Sahani2021-01-181-0/+1
|
* network: wait-online - use hashmap_ensure_putSusant Sahani2021-01-181-10/+2
|
* Merge pull request #18243 from ssahani/ensure-put-useYu Watanabe2021-01-171-4/+2
|\ | | | | tree-wide: introduce hashmap_ensure_put() and use it
| * network: online - use hashmap_ensure_putSusant Sahani2021-01-151-4/+2
| |
* | network: tighten variable scope used in loop (#18277)Susant Sahani2021-01-171-2/+1
|/
* Merge pull request #17478 from yuwata/split-network-internalYu Watanabe2020-11-271-1/+0
|\ | | | | libsystemd-network: split network-internal.c
| * tree-wide: drop unnecessary inclusion of network-internal.hYu Watanabe2020-10-291-1/+0
| |
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-095-5/+5
|/
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-081-5/+3
|
* network: drop doubled white spaceYu Watanabe2020-07-151-1/+1
|
* 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.