| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
args list
|
|
|
|
|
|
|
| |
Follow-up for 2d708781620239c9d1f9828a39f8761acf6350b2.
After the conversion from FOREACH_POINTER() to FOREACH_ARGUMENT(),
the iterator is never set to POINTER_MAX.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The latter is more generic and while being compatible with
the former.
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
unmanaged during processing it
Closing #27145.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
No functional changes, just refactoring and preparation for later
commits.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
sd_netlink_message_set_request_dump
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
A quick typo fix I noticed whilst debugging.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
degraded
Closes #21706.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| | |
yuwata/network-wait-online-address-family-follow-ups
network: several follow-ups for #19069
|
| | |
|
|\ \
| |/
|/| |
tree-wide: avoid uninitialized warning on _cleanup_ variables
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
This introduce -4 and -6 commandline options.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Now that we know we have something useful, no need to make an answer up.
|
|
|
|
| |
It may be useful when debugging daemons.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|\
| |
| | |
tree-wide: introduce hashmap_ensure_put() and use it
|
| | |
|
|/ |
|
|\
| |
| | |
libsystemd-network: split network-internal.c
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|