Reuse the to-string function nm_platform_link_inet6_addrgenmode2str() to print the
addrgenmode for nm_platform_link_to_string().
Also, now we support NM_IN6_ADDR_GEN_MODE_STABLE_PRIVACY.
If we break the loop normally, @err must be already set to zero.
The only other way this can happen is when the credentials are
invalid. Move setting @err to there.
If @handle_events is FALSE, we want to drain the socket. In that case
even when encountering an error error we don't want to abort, but instead
continue reading the next message.
@abort_parsing is set TRUE at two places, which also explicitly
set @err to something. We don't want to reset @err and got to the
next @hdr. Instead error out first.
Unenslaving from a bridge can cause a spurious RTM_DELLINK signal.
NMPlatform does raise those signals, but fixes the state of the
cache afterwards. Workaround the test failure.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1285719
Change the dhcp-timeout property in NMSettingIPConfig to int type for
consistency with the dad-timeout property. For dad-timeout -1 means
"use default value", while for dhcp-timeout probably we will never use
negative values, but it seems more correct to use the same type for
the two properties.
This breaks API and ABI for the functions related to Reapply,
which got introduced in the current 1.1 development phase.
The version-id is here to allow users to error out if the connection
on the device was changed by a concurrent action.
https://bugzilla.gnome.org/show_bug.cgi?id=761714
This field will be later used by NMDevice's Reapply and
GetAppliedConnection methods. The usecase is to first fetch
the currently applied connection, adjust it and reapply it.
Using the version-id, a concurrent modification can be detected
and Reapply can reject the invocation.
Otherwise, a tun device from external openvpn service will be managed by
NetworkManager.
<debug> [1455615148.716529] [devices/nm-device.c:9082] _set_unmanaged_flags(): [0x55e6f5756070] (tun7): unmanaged: flags set to [!sleeping,!loopback,!platform-init,!user-config,!external-down=0x0/0xa19/managed, set-managed [platform-init=0x10], reason managed, transition-state)
<info> (tun7): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Fixes: 87a3df2e57
Some drivers (or things outside NM like 'powertop') may turn powersave
on, so don't touch it unless explicitly configured by user.
To achieve this, add new 'default' and 'ignore' options; the former
can be used to fall back to a globally configured setting, while the
latter tells NM not to touch the current setting.
When 'default' is specified, a missing global default configuration is
equivalent to 'ignore'.
It is possible to enable Wi-Fi power saving for all connections by
dropping a file in /etc/NetworkManager/conf.d with the following
content:
[connection]
wifi.powersave=3
https://bugzilla.gnome.org/show_bug.cgi?id=760125
RFC 3442 allows a default gateway to be specified in option 121
(Classless Static Routes) and override the Router option. Implement
this in the internal DHCP client.
https://bugzilla.gnome.org/show_bug.cgi?id=761268
Get rid of NM_UNMANAGED_DEFAULT and refine the interaction between
unmanaged flags, device state and managed property.
Previously, the NM_UNMANAGED_DEFAULT was special in that a device was
still considered managed if it had solely the NM_UNMANAGED_DEFAULT flag
set and its state was managed. Thus, whether the device (state) was managed,
depended on the device state too.
Now, a device is considered managed (or unmanaged) based on the unmanaged
flags and realization state alone. At the same time, the device state
directly corresponds to the managed property of the device. Of course,
while changing the unmanaged flags, that invariant is shortly violated
until the state transistion is complete.
Introduce more unmanaged flags whereas some of them are non-authorative.
For example, the EXTERNAL_DOWN flag has only effect as long as the user
didn't explicitly manage the device (NM_UNMANAGED_USER_EXPLICIT). In other
words, certain flags can render other flags ineffective. Whether the device
is considered managed depends on the flags but also at the explicitly unset flags.
In a way, this is similar to previous where NM_UNMANAGED_DEFAULT was ignored
(if no other flags were present).
Also, previously a device that was NM_UNMANAGED_DEFAULT and in disconnected
state would transition back to unmanaged. No longer do that. Once a device is
managed, it stays managed as long as the flags indicate it should be managed.
However, the user can also modify the unmanaged flags via the D-Bus API.
Also get rid or nm_device_finish_init(). That was previously called
by NMManager after add_device(). As we now realize devices (possibly
multiple times) this should be handled during realization.
https://bugzilla.gnome.org/show_bug.cgi?id=746566
It could be that what changed is the unrealize flag, not the number available
connections. That could happen when a last connection for a software device
is removed.
The nm_device_check_connection_available() call seem to have been accidentally
removed from nm_device_recheck_available_connections() resulting in all
connections always being added.
Fixes 02ec76df5a
This should avoid a race when stopping dnsmasq.
This is still a hack, because we don't want to ever wait
for a process to terminate.
A better solution would be to have nm-dnsmasq-manager managing
the global state. Not only the dnsmasq instance of on NMDevice.
Instead it should keep track of all the child processes it starts
and it wants to start. This way, starting a new process should be
delayed until any (child or non-child) instances are gone.
That however would be a bigger change.
https://bugzilla.gnome.org/show_bug.cgi?id=728342https://bugzilla.gnome.org/show_bug.cgi?id=762008
Often a netlink event doesn't contain enough information to determine
the link type. Then we consult sysctl or ethtool. However, if we already
have the same object cached, we want to reused the (once detected) link-type.
There was a bug in lookup of the cached object.
- "gsystem-local-alloc.h" and <gio/gio.h> are already included via
"nm-default.h". No need to include them separately.
- include "nm-macros-internal.h" via "nm-default.h" and drop all
explict includes.
- in the modified files, ensure that we always include "config.h"
and "nm-default.h" first. As second, include the header file
for the current source file (if applicable). Then follow external
includes and finally internal nm includes.
- include nm headers inside source code files with quotes
- internal header files don't need to include default headers.
They can savely assume that "nm-default.h" is already included
and with it glib, nm-glib.h, nm-macros-internal.h, etc.
Due to a kernel bug [1], we sometimes receive spurious NEWLINK
messages after a wifi interface has disappeared. Since the link is not
present anymore we can't determine its type and thus it will show up
as a Ethernet one, with no address specified. Request the link again
to check if it really exists.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1302037https://bugzilla.gnome.org/show_bug.cgi?id=761151
The dnsmasq process started as DHCP and DNS server for shared
connections now accepts additional configuration files at
/etc/NetworkManager/dnsmasq-shared.d/.
https://bugzilla.gnome.org/show_bug.cgi?id=761717
When NM tries to match a generated connection to a persistent one, it
considers also the metric of static routes. However, if the field is
set to -1 (use default value for the device) on the persistent
connection, the comparison will always fail because the generated
connection contains the actual value read from kernel.
To fix the issue, modify check_possible_match() to deal correctly with
-1 and translate it to the expected value for the current device when
performing the comparison.
This allows connections with static routes and default metric to
properly be re-assumed when NM is restarted.
https://bugzilla.redhat.com/show_bug.cgi?id=1302532