| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(cherry picked from commit 0f7098b71bbfc6024b0f39ce858448d928af6ae5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
match_device_s390_subchannels_parse() asserts that arguments point to
zeroes.
1299 static gboolean
1300 match_data_s390_subchannels_eval (const char *spec_str,
1301 MatchDeviceData *match_data)
1302 {
>>> CID 160923: Uninitialized variables (UNINIT)
>>> Declaring variable "c" without initializer.
1303 guint32 a, b, c;
Fixes: b0aaff86b61b9267cbc7640836823bbba82668b8
(cherry picked from commit 20328eaddfbe27bf3c9fbff9bfda56160fd2a77f)
|
|
|
|
|
| |
Fixes: 665e3980221c04c327b3c165f4a3f82fe470e87e
(cherry picked from commit ec66135a40efa2326494af6e99f203654a302a69)
|
|
|
|
|
|
|
|
|
|
|
| |
For better or worse, nm_exported_object_unexport() asserts that the
object is currently exported.
It's not clear that an active connection at this place is always
exported.
Fixes: f0e3dfdace25bf19c6a6b1f1cee4e384de64c433
(cherry picked from commit c8a649b3ded70f63e5f3f7f3f75282d4cd8b0590)
|
|
|
|
|
|
|
|
|
| |
The active connection has an immutable connection property, but is
cleaned asynchronously by the manager after its settings connection is
done. Fine, let's remove it from the bus first though, so that we don't
hang there with a dangling object path.
(cherry picked from commit f0e3dfdace25bf19c6a6b1f1cee4e384de64c433)
|
|
|
|
|
|
|
|
|
|
|
| |
When searching for "*", we still need to check for higher priority
"except:" matches. But don't duplicate the search loop and just
proceed with the regular searched.
It already has the "if (!except && match == NM_MATCH_SPEC_MATCH)" which
short-cuts the search.
(cherry picked from commit 9fff9f501ad984810b663d068c46b292fc9bc2a3)
|
|
|
|
|
|
|
|
|
|
| |
Instead of passing on invdividual arguments for the match, create
a MatchDeviceData structure and pass it on.
This reduces the number of arguments and extending it later should
be easier. Also, lazily parse the hardware address as needed.
(cherry picked from commit b0aaff86b61b9267cbc7640836823bbba82668b8)
|
|
|
|
| |
(cherry picked from commit b0e58a982374c56d06961d88a0b1551a8d8937bd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we would have different functions like
- nm_match_spec_device_type()
- nm_match_spec_hwaddr()
- nm_match_spec_s390_subchannels()
- nm_match_spec_interface_name()
which all would handle one type of match-spec.
So, to get the overall result whether the arguments
match or not, nm_device_spec_match_list() had to stich
them together and iterate the list multiple times.
Refactor the code to have one nm_match_spec_device()
function that gets all relevant paramters.
The upside is:
- the logic how to evaluate the match-spec is all at one place
(match_device_eval()) instead of spread over multiple
functions.
- It requires iterating the list at most twice. Twice, because
we do a fast pre-search for "*".
One downside could be, that we have to pass all 4 arguments
for the evaluation, even if the might no be needed. That is,
because "nm-core-utils.c" shall be independend from NMDevice, it
cannot receive a device instance to get the parameters as needed.
As we would add new match-types, the argument list would grow.
However, all arguments are cached and fetching them from the
device's private data is very cheap.
(cherry picked from commit b957403efd53ff7d826ac7a4f80487032c03824b)
|
|
|
|
|
|
|
|
|
|
| |
After commit 553717bb1c9e ("device: don't set ip4_state=IP_FAIL for
ipv4.method=disabled"), we commit an empty IPv4 configuration when
IPv4 is disabled. This means that it's not necessary anymore to call
_commit_mtu() because the MTU will be set in
ip4_config_merge_and_apply().
(cherry picked from commit 714b18dcf77d029a53c3b371c2f05bd5c7cc3bff)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After commit 22e8af624285 ("device: set a per-device default MTU on
activation") we explicitly set the VLAN MTU to 1500 if not overridden
by user settings. This has the advantage that the MTU is set to a
predictable value, while before it could have different values
depending on when the interface was created (for example, the
interface would get a 1500 MTU if created during boot, or would
inherit the parent's MTU if activated manually).
However, a better default value is the MTU of the parent interface
which is in most cases what the user wants. This value was the default
before commit 22e8af624285 for manually activated connections.
https://bugzilla.redhat.com/show_bug.cgi?id=1414186
(cherry picked from commit 7dde8d81060405c9c8f45be76300cdac7868fba4)
|
|
|
|
| |
(cherry picked from commit ba47744997091562ad1844c28d07a6de16a7c0bf)
|
|
|
|
|
| |
Fixes: 4dbaac4ba24ebc8b257fffe5197cc8e362804a58
(cherry picked from commit 59f37f31d9747a7071d720367e0fe69007fc7570)
|
|
|
|
|
| |
Fixes: 992beb4f3440b046e0ba03e300d62da946a6f40e
(cherry picked from commit af16cd5a927e4b47564952ad5342731f36714a31)
|
|
|
|
|
|
| |
src/devices/nm-device.c:8319:4: error: invalid use of void expression
(cherry picked from commit a4d61bf29905ac9e5c7e6f99344733a4ccb2297f)
|
|
|
|
|
|
|
|
|
|
| |
We start to track changes to the device's properties only after the
active connection gets activated. It's wrong to return properties
while we don't track their changes as this causes stale objects
references on D-Bus. Let's return DHCP and IP configurations from the
device only when the connection is activated.
(cherry picked from commit 4215c2640a6a24360fc0bfc59f45c6af3132ebb4)
|
|
|
|
| |
(cherry picked from commit 19ceaa1dc99f7fcbc443f938c018a0cb93a65d5e)
|
|
|
|
|
|
|
|
|
|
|
| |
supplicant-interface
As the fast-supported flag changes, update the existing supplicant
interfaces with the new information.
Also, by default assume it is supported.
(cherry picked from commit 872b9ec5ea20c702ccb08eab75ca012a7aa1895f)
|
|
|
|
|
|
|
|
|
|
|
| |
At least with my supplicant, the capability is called
all-upper-case "FAST".
The check used case-insensitive, but that was broken
by a previous change.
Fixes: 9f5f141100e390015341aee1f2fb50f7626da3b1
(cherry picked from commit 66ff601ecff0c740f449b61489397b75393f6ff2)
|
|
|
|
| |
(cherry picked from commit a5acd0bdc63449d9b499b62479f612c216cf24c0)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basically to silence gcc that is not smart enough to understand how does
.initialized and .value relate.
src/devices/nm-device.c: In function '_commit_mtu':
src/devices/nm-device.c:6754:15: error: 'ip6_mtu_sysctl.value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ()) {
^
(cherry picked from commit 7ce805d49d25fec60b50b4c53459df835512d279)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows a user to restore the previous behavior where NetworkManager
would not reconfigure the MTU during device activation, if no MTU is
available (commit "22e8af6 device: set a per-device default MTU on
activation").
Well, not exactly. The previous behavior was to use per-connection
configuration, then DHCP provided value, or finally leave the MTU
unspecified.
Now, we prefer a per-connection configuration, followed by a global
connection default. If "ethernet.mtu=0", the MTU is left unspecified.
In absense of a global connection default, the value from DHCP is used
or finally a per-device-type default. That is effectively 1500 for most
types, except for infiniband where the MTU is still left unspecified.
|
|
|
|
|
|
|
| |
nm_platform_sysctl_open_netdir() doesn't take it anyways, gets it from
the cache.
CID 160209 (#1 of 1): Unused value (UNUSED_VALUE)
|
|
|
|
|
|
| |
The presence of a parameter is checked above.
CID 59899 (#1 of 1): Logically dead code (DEADCODE)
|
|
|
|
|
|
|
| |
Add code to nm-device-macsec.c to support the creation of macsec
connection. Most of the code for controlling wpa_supplicant is copied
from nm-device-ethernet.c and probably could be consolidated in some
ways.
|
|
|
|
| |
With macsec we now have 3 drivers and a boolean is no longer enough.
|
|
|
|
| |
Add new configuration options for wpa_supplicant to support MACsec.
|
|
|
|
|
| |
At the moment the device only exposes the current link status, but
cannot create new links.
|
|
|
|
|
| |
Add support for a new macsec link type and its netlink attributes to
the platform code.
|
|
|
|
|
| |
Replace the custom supplicant_iface_connection_error_cb_handler() with
nm_device_queue_state().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In absence of an explicit MTU (either via user configuration, PPP or
DHCP), set a default MTU on activation that depends on the device type.
We only want to do that on the very first call to _commit_mtu(). Later
calls (for example in response to new DHCP leases) skip over this step.
This means, on activation the MTU will always be reset to a sensible
value instead of preserving whatever was left from a previous
configuration.
This does not cover setting the MTU from the VPN plugin :(
|
|
|
|
|
|
|
|
|
|
| |
When you have a connection with "ethernet.mtu=0 (auto)", the MTU is not set
during activation. That means, the effective MTU depends on the previous
MTU configuration of the device. Which in turn, depends on the
previously active connection, as we don't reset the MTU on deactivation.
Restore the previous MTU on deactivation iff NetworkManager changed
the MTU during device activation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't have this mtu_desired variable. All the data is readily available
without redundancy. E.g. the applied-connection contains everything
we need to know. Just get it as needed.
Also drop apply_mtu_from_config(). It didn't take into account
the MTU settings beside NMSettingWired.
Also, no longer merge the NM_IP_CONFIG_SOURCE_USER MTU value into
priv->ip4_config. NMIP4Config now only tracks the MTU from the various
non-user-config sources, but the user config is no longer merged back
into the composite.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is wrong that nm_ip4_config_set_mtu() tries to ~merge~ the new MTU
with the existing. All callers of nm_ip4_config_set_mtu() want that the
new value prevails.
That is also already the case because the DHCP clients and PPP manager set
the MTU on a newly created NMIP4Config instance, thus their value is taken.
Similarly, the final merge with NM_IP_CONFIG_SOURCE_USER also prevails as the
source has the highest priority.
The setter should just set. The only place where we want the merge behavior
is in nm_ip4_config_merge(), where it is now implemented in-place.
For example, nm_ip4_config_replace() very much wants that the new value
wins, regardless of the previous setting. Using nm_ip4_config_set_mtu()
with the merge behavior was wrong because it means that the MTU of NMDevice's
composite can never be raised again (for example with a new DHCP event).
|
|
|
|
|
|
|
|
| |
The problem is that the bridge's MTU cannot be larger then the slaves'.
Configuring such a setting results in an error being logged and the
activation proceeds (without applying the desired MTU).
Unclear how to fix that best.
|
|
|
|
|
|
|
|
|
| |
Instead of overwriting ip4_config_pre_commit(), add a new function
get_mtu().
This also adds a default value in case there is no user-configuration.
This will allow us later to reset a default MTU based on the device
type.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The field priv->mtu should contain what is actually configured
on the device, as that field is also exposed on D-Bus as NM_DEVICE_MTU
property.
That shall be handled distinct from what we want to configure as
MTU on the device.
Refactor the handling of MTU with a new functoin _set_mtu() which looks
at the desired paramters and compares it with what is configured (in
platform and sysctl). Then it makes a decision what to configure.
|
|
|
|
|
|
|
|
|
|
|
| |
Mark priv->mtu/priv->ip_mtu/ priv->ip6_mtu as const to highlight the
places that explicitly set their mutable aliases priv->mtu_/
priv->ip_mtu_/priv->ip6_mtu_.
Also, NM_DEVICE_MTU property is read-only. It cannot be set
via g_object_set().
Also, clear priv->mtu in nm_device_unrealize().
|
| |
|
|
|
|
|
| |
For the assertion use nm_streq0(). If we bother checking for invalid
values (that are supposed to never happen), avoid a possible crash too.
|
|
|
|
|
| |
The only caller wants to read the MTU, which is more
type guint32 then gint32.
|
|
|
|
|
|
|
|
|
| |
bool:1 bitfields allow for tighter packing and are guaranteed to be
strictly 0 or 1 (contrary to gboolean's typedef for int). Not that it
matters too much, but it's favorable.
Especially, because each device has several of these ip-config instances,
we might save a few bytes for no(?) downsides.
|
|
|
|
|
| |
Move the GObject related functions to the end of the source file.
Similar to how it's done for most other implementations.
|
| |
|
|
|
|
|
|
| |
We end up calling nmp_cache_id_init_*() a lot to initialize stack-allocated
cache-ids to lookup the NMMultiIndex. There is no need to memset() it to
zero, because all relevant fields are supposed to be set explicitly.
|
| |
|
| |
|