Instead of using (only) a hard-coded list of VPN types,
prefer lookup the VPN settings from the .name files.
Still, fallback to a hard-coded list if the plugin cannot
be found, because for connection-add we currently don't
actually need the plugin installed.
Just like `nmcli device connect` only allows one argument, don't allow
multiple device arguments for reapply.
Allowing multiple device names makes it more complicated to add
additional options to the command. For example, it would be useful
to have a
nmcli device reapply eth0 connection id other-connection
but when allowing multiple device names, it gets more complicated in
documentation, command line parsing and bash completion.
Note that the user can achieve a very similar outcome by using the
shell:
for DEV in eth0 eth1 eth2; do
nmcli device reapply $DEV &
done
wait
argubaly, this doesn't report the exit status properly. To properly
handle that would require more effort. Also, it is somewhat less
efficient, but well.
This is an API change, however it is very new API that probably nobody
is using much. Also, the documentation (man nmcli) didn't mention the
possibility to pass multiple device names.
When performing NM package upgrade the new version of nmcli will be immediately
available while NM daemon will not, as it would not restart in order to avoid
to disrupt connectivity. This could create issues with tools leveraging
on nmcli output (till reboot). As apart from this case it is very unlikely
that a user can have this nmcli / NM daemon version mismatch situation,
the check could cause more harm than benefit in real user case
scenarios.
https://bugzilla.redhat.com/show_bug.cgi?id=1291785
For internal compilation we want to be able to use deprecated
API without warnings.
Define the version min/max macros to effectively disable deprecation
warnings.
However, don't do it via CFLAGS option in the makefiles, instead hack it
to "nm-default.h". After all, *every* source file that is for internal
compilation needs to include this header as first.
The bond 'arp_ip_target' option contains a list of comma-separated IP
addresses; but comma is also used to separate options and so at the
moment it is not possible to specify multiple IPs as the command
$ nmcli c m b1 bond.options \
mode=0,arp_interval=1,arp_ip_target=1.1.1.1,2.2.2.2
interprets 2.2.2.2 as the next option.
Allows spaces to be used as separators for the IPs of the
'arp_ip_target':
$ nmcli c m b1 bond.options \
"mode=0,arp_interval=1,arp_ip_target=1.1.1.1 2.2.2.2"
We actually don't want to understand these options unless the legacy
*-slave types are used. The properties should be used directly instead.
https://bugzilla.gnome.org/show_bug.cgi?id=748302
This basically undoes most of what has been done in commit 00e0fffea2.
In previous releases 'nmcli connection m' was interpreted as 'modify',
but recently the monitor command was introduced with a higher
priority, changing the behavior when the abbreviated form is
used.
Restore the old behavior.
https://bugzilla.redhat.com/show_bug.cgi?id=1316120
Use g_error_matches() where we're testing error codes. In particular,
use it rather than looking at only ->code and not also ->domain, which
is just wrong.
[thaller@redhat.com: rebase and modify original patch]
Functions that take a GError** MUST fill it in on error. There is no
need to check whether error is NULL if the function it was passed to
had a failing return value.
Likewise, a proper GError must have a non-NULL message, so there's no
need to double-check that either.
Based-on-patch-by: Dan Winship <danw@gnome.org>
- All internal source files (except "examples", which are not internal)
should include "config.h" first. As also all internal source
files should include "nm-default.h", let "config.h" be included
by "nm-default.h" and include "nm-default.h" as first in every
source file.
We already wanted to include "nm-default.h" before other headers
because it might contains some fixes (like "nm-glib.h" compatibility)
that is required first.
- After including "nm-default.h", we optinally allow for including the
corresponding header file for the source file at hand. The idea
is to ensure that each header file is self contained.
- Don't include "config.h" or "nm-default.h" in any header file
(except "nm-sd-adapt.h"). Public headers anyway must not include
these headers, and internal headers are never included after
"nm-default.h", as of the first previous point.
- Include all internal headers with quotes instead of angle brackets.
In practice it doesn't matter, because in our public headers we must
include other headers with angle brackets. As we use our public
headers also to compile our interal source files, effectively the
result must be the same. Still do it for consistency.
- Except for <config.h> itself. Include it with angle brackets as suggested by
https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
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
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
- "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.
connections.c: In function ‘sort_connections’:
connections.c:1536:3: error: ‘return’ with no value, in function returning non-void [-Werror=return-type]
return;
^
Fixes: e8927c14ec
Coverity complains:
CID 59386 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking cons suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
The device never returns NULL access point list, it only deallocates it on
dispose(). Make this clear for Coverity:
CID 59387 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking aps suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Up to now, the "include" directory contained (only) header files that were
used project-wide by libs, core, clients, et al.
Since the directory now also contains a non-header file, the "include"
name is misleading. Instead of adding yet another directory that is
project-wide, with non-header-only content, rename the "include"
directory to "shared".
Make it possible to change ethernet.mtu and
ethernet.cloned-mac-address properties of tun/tap devices
(cloned-mac-address is meaningful only for taps).