| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
If only to hit some of the code paths in our test, and to have valgrind
check (some of) the code paths.
|
|
|
|
|
| |
Counters are convenient for debugging, but have a performance overhead.
Configure them only when debug logging in NetworkManager is enabled.
|
|
|
|
|
|
|
|
|
| |
g_assert_cmpmem() exists, but it does not print the actual buffer content on test failure.
It is useful to see what actually failed in the test output.
Also, nmtst_assert_cmpmem() prints a backslash escaped output, that you
can unescape in the terminal with `echo -e`. You can also directly copy
and paste the output to C source code.
|
|
|
|
|
|
|
|
| |
double quotes
This is useful when printing a string for debugging. Then we can
printf("v=\"%s\"", utf8safe_escaped_text), which can be safely unescaped
with `echo -e`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to systemd, IPv6 forwarding is special anyway, and they only
enable forwarding for "net.ipv6.conf.all.forwarding" ([1]).
Since commit 46e63e03af58 ('device: announce the managed IPv6
configuration with ipv6.method=shared') we support "ipv6.method=shared"
and enable forwarding for IPv6, on the interface. Whether that makes
sense is questionable, given [1] and the claim that setting it
per-interface is not useful.
Anyway, since that change we always reset the "forwarding" sysctl to
zero, when we don't enable shared mode. That is not right, because the
user didn't explicitly ask for that (and there is no configuration
option like systemd-networkd's "IPForward=" setting to control that).
What we instead should do, not touch/reset the sysctl, unless we really
want to.
No longer set "forwarding" to zero by default. And only restore the
previous value (_dev_sysctl_save_ip6_properties()) if we actually
changed the value to "1".
[1] https://github.com/systemd/systemd/blob/b8fba0cded2c3e14fe8c0b52aae3ecf2c9fa718e/src/network/networkd-sysctl.c#L79
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/923
Fixes: 46e63e03af58 ('device: announce the managed IPv6 configuration with ipv6.method=shared')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1616
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These stages were not properly implemented and don't seem to work.
Drop them.
Note that we do want that our cached containers get collected eventually.
As these are just caches for performance reasons, that could be done with
little downsides (we can just regenerate the containers when we need them).
However, that's not done by our gitlab-ci stages. Instead, it should
be done on a project level. It's not clear whether that is actually done,
but if there is a need (because of the resources that this wastes), then
we should do that (on freedesktop.org's gitlab instance).
|
|\
| |
| |
| | |
git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
b2a382ac4500 test: use inet_pton() instead of inet_aton() in test tool
45df6a37a710 meson: no longer pass -Wl,--no-undefined explicitly
bb9bcdee5754 n-dhcp4-client: make n_dhcp4_client_set_log_level public
git-subtree-dir: src/n-dhcp4
git-subtree-split: b2a382ac4500dee1abfb7cd5acaa3678e47e9662
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
See-also: https://bugs.python.org/issue37495
https://bugzilla.redhat.com/show_bug.cgi?id=2049134
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1620
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
nm_inet_parse_bin_full() supports a legacy mode for IPv4, which used
inet_aton(). This is only used by initrd reader, which parses the
kernel command line as defined by dracut. Since that dracut API is old
and not defined by us, we want to be more forgiving in case a user
specifies something that used to work in the past. In particular,
we want to parse "255.256.256.000" as netmask (which inet_pton() would
reject).
inet_aton() trips off some ABI checkers that we shouldn't use this ABI.
It was anyway only used as *additional* guard when we parsed certain
legacy formats for IPv4 addresses. We can drop that and just use our
parser.
Note that there is still an nm_assert() path, which loads inet_aton()
dynamically, just to ensure that our legacy parser implementation is in
agree with inet_aton().
https://bugzilla.redhat.com/show_bug.cgi?id=2049134
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
autoclosing them
An issue/merge-requests only moves forward by a human putting effort in.
Wether the issue is open, closed, autoclosed or flagged with a "stale"
label doesn't matter in theory.
In practice, humans don't like getting their issues/merge-requests
autoclosed. Instead, add a "stale" label.
There was always a benefit of this automatic action. It tended to
generate some feedback and new action. Sometimes it even brought new
attention to the issue/merge-request to get it fixed. That is hopefully
also the case with the stale label.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The manual page is large. When you search for a properties, then it's
not immediately clear to which setting it belongs. You would have to
scroll up for the setting name.
This also makes sense for the nmcli manual page, because on the command
line you have to specify the full name.
|
|\ \
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1618
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For efficiently and conveniently lookup an NMSetting from the
NMConnection inside the NMSettingsConnection.
Note that this uses the NMMetaSettingType as lookup key. That is a novel
approach, compared to lookup by name (nm_connection_get_setting_by_name())
or GType (nm_connection_get_setting()).
Using the NMMetaSettingType enum is however faster, because it does not
require resolving the name/GType first. This is perfecly fine internal API,
we should use it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have several variants to get the NMSetting from an NMConnection. Some
of them are public API (nm_connection_get_setting(), nm_connection_get_setting_by_name()).
The most efficient way is lookup by NMMetaSettingType. Expose that as
internal API, so it can be used. The NMMetaSettingType is internal, but
it exists because it's a very useful enum. Allow others to make use of
it.
Also, add a static assert which prevents various wrong uses at compile
time, for example
_nm_connection_get_setting_by_metatype(connection, NM_TYPE_SETTING_CONNECTION)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Refactor and cleanup the functions to get a setting from a connection.
As the NMConnection tracks the settings in an array indexed by
NMMetaSettingType, the most direct and efficient way is to look up via
that enum.
Previously, nm_connection_get_setting_by_name() would first look up the GType
(which already involved looking up the NMMetaSettingInfo), then based on the
GType it would look up the NMMetaSettingInfo again to get the meta_type. That
is unnecessary. Directly look up the NMMetaSettingInfo, which directly
gives the meta_type.
|
|/ /
| |
| |
| |
| | |
This function will be exposed on the internal header. Rename to
_nm_connection_get_setting_by_metatype().
|
|\ \
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1615
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
activate_slave_connections()
We need to detect when nothing relevant changes, and shortcut doing things when they
are unnecessary.
|
| | |
| | |
| | |
| | | |
nm_manager_devcon_autoconnect_retries_reset()
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It seems better for readability, because reacting based on the state-reason
is ugly already. This way, we access nm_device_state_reason_check(reason) only
at once place. With the if, it's not immediately obvious that both if/else
parts only switch on the reason too.
|
| | |
| | |
| | |
| | |
| | | |
Otherwise, we create device × profiles entries, most of
them nonsensical.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cleanup logging to always print a "block-autoconnect:" prefix to related
lines. Also, make sure that everywhere where the state changes, a line
gets logged. Also, for devconf data print both the interface and the
profile.
|
|/ /
| |
| |
| |
| |
| | |
We only have a few blocked reasons. Some of them can be only set on the
devcon data, and some only on the settings connection. Assert that we
don't mix that up.
|
| | |
|
|\ \
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1564
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add per port priority support for bond active port re-selection during
failover. A higher number means a higher priority in selection. The
primary port still has the highest priority. This option is only
compatible with active-backup, balance-tlb and balance-alb modes.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
sysfs is deprecated and kernel will not add new bond port options to
sysfs. Netlink is a stable API and therefore is the right method to
communicate with kernel in order to set the link options.
|
|/ /
| |
| |
| | |
The correct variable for queue-id in ifcfg is BOND_PORT_QUEUE_ID.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A workaround for a nftables issue ([1]). I don't know why that matters.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=2177667
Fixes: e9268e392418 ('firewall: add mlag firewall utils for multi chassis link aggregation (MLAG) for bonding-slb')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1614
|
|\ \
| | |
| | |
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1281
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1613
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Names are important. The previous name was counter intuitive for what
the behavior was.
|
| | |
| | |
| | |
| | | |
It translates to a plain memcmp() as the argument is a string literal.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The previous logging happened, when the value did not change. Log
instead, when the value changes.
Fixes: 86bb09c93be3 ('dns: generate correct search domain for hostnames on non-public TLD')
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
dns-manager uses the Mozilla Public Suffix List to determine an
appropriate search domain when generating /etc/resolv.conf. It is
presumed that if the hostname is "example.com", the user does not want
to automatically search "com" for unqualified hostnames, which is
reasonable. To implement that, prior to the fix, domain_is_valid()
implicitly used the PSL "prevailing star rule", which had the
consequence of assuming that any top-level domain (TLD) is public
whether it is on the official suffix list or not. That meant
"example.local" or "example.localdomain" would not result in searching
"local" or "localdomain" respectively, but rather /etc/resolv.conf would
contain the full hostname "example.local" as the search domain and not
give users what they expect. The fix here uses the newer PSL API
function that allows us to turn off the "prevailing star rule" so that
"local" and "localdomain" are NOT considered public TLDs because they
are not literally on the suffix list. That in turn gives us the search
domain "local" or "localdomain" in /etc/resolv.conf and allows
unqualified hostname lookups "e.g., resolvectl query example" to find
example.local while example.com still maintains the previous behavior
(i.e., search domain of "example.com" rather than "com").
[thaller@redhat.com: reworded commit message]
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1281
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1613
|
| | |
|
| |
| |
| |
| | |
To be consistent with other defines.
|
| |
| |
| |
| |
| |
| |
| |
| | |
With a large number of interfaces, it can take longer than 45 seconds
before NetworkManager is started (and the D-Bus name acquired). Increase
the start timeout.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1612
|
| |
| |
| |
| |
| |
| | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1275
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1611
|
|\ \
| | |
| | |
| | | |
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1597
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before commit a42682d44fe2 ('device: take reference to device object
before 'delete_on_deactivate''), we used a weak pointer to track the
idle action.
As we now use a strong reference, we can store all data about the idle
action in NMDevice itself. Drop DeleteOnDeactivateData.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
NMDevice holds a reference to NMManager, which holds a reference to NMPolicy.
It is not possible that we try to dispose NMPolicy while there are still devices
registered. That would be a bug, that we need to find and solve
differently. Add an assertion instead of trying to handle it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add an assertion to nm_policy_device_recheck_auto_activate_schedule(),
that the device is currently registered in NMPolicy. Calling it outside
would be odd, and likely a bug.
But if we only register the auto-activate while being registered, we
don't need to take an additional reference. We know that the object must
be be alive (also, we have assertions that in fact it is still alive).
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Hook the information for tracking the activation of a device, to the
NMDevice itself. Sure, that slightly couples the NMPolicy closer to
NMDevice, but the result is still simpler code because we don't need a
separate ActivateData.
It also means we can immediately tell whether the auto activation check
for NMDevice is already scheduled and don't need to search through the
list.
|
| | |
| | |
| | |
| | |
| | |
| | | |
NMPolicy really should be merged into NMManager. It has not a clear responsiblity
so that there are two separate objects only makes things confusing. Anyway. It
is permissible to look up the NMPolicy instance of a NMManager. Add an accessor.
|
| | |
| | |
| | |
| | |
| | |
| | | |
"nm-manager.c"
No need to call down to the device, to call back up to the NMManager.
|