Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
3d25b2e1a1 cli: merge branch 'th/cli-vpn-import-fixes-rh1337300'
https://bugzilla.redhat.com/show_bug.cgi?id=1337300
2016-05-19 12:56:47 +02:00
Thomas Haller
d0f01aa2c2 clients,cli: show better error message when failing to load VPN plugin
VPN plugins are often not installed or they might be legacy-only.
In both cases we should show a better error message about the
failure reason.
2016-05-19 12:52:59 +02:00
Thomas Haller
41976e3069 clients,cli: for connection-add consider VPNs as loaded from the plugin
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.
2016-05-19 12:52:59 +02:00
Thomas Haller
2b4b9d34e4 clients: don't assert against existance of plugin in nm_vpn_supports_ipv6()
Obviously, loading a plugin can fail easily.
2016-05-19 12:52:59 +02:00
Thomas Haller
0225c4567b clients: lookup VPN plugins either by "name" or "service"
... not constructing a "service" by prepending a D-Bus prefix to "name" (urgh).
2016-05-19 12:52:59 +02:00
Thomas Haller
09a015b23b nmcli-completion: complete filename for VPN import and passwd-file
Also hard-code the VPN types strongswan and fortisslvpn.

https://bugzilla.redhat.com/show_bug.cgi?id=1337300
2016-05-19 12:52:59 +02:00
Thomas Haller
e0e1c59160 NEWS: fix mistake in NEWS file about wifi.mac-address-randomization 2016-05-19 12:11:38 +02:00
Lubomir Rintel
71fa3cb810 merge: branch 'lr/ld-gc'
Make NetworkManager small again!
2016-05-19 11:30:57 +02:00
Lubomir Rintel
c8f65e95fd build: garbage collect unused symbols by default
GCC can place each symbols into separate sections making it possible for
ld to discard unneeded sections (and thus symbols afterwards). This achieves
almost the same size benefits as LTO without the huge performance
penalty (and the undefined behavior with -g).

The cost of more section headers in .o files seems to be negligible.

Before:

  359.73user 71.94system 1:29.67elapsed 481%CPU (0avgtext+0avgdata 137948maxresident)k

     text        data     bss     dec     hex filename
  2772228       74848    9272 2856348  2b959c src/NetworkManager

With LTO:

  740.37user 94.89system 4:13.83elapsed 329%CPU (0avgtext+0avgdata 118316maxresident)k

     text        data     bss     dec     hex filename
  2435437       74224    8704 2518365  266d5d src/NetworkManager

With --gc-sections:

  365.63user 72.34system 1:30.12elapsed 485%CPU (0avgtext+0avgdata 138016maxresident)k

     text        data     bss     dec     hex filename
  2498498       74040    8408 2580946  2761d2 src/NetworkManager
2016-05-19 11:06:55 +02:00
Lubomir Rintel
6d91c14b00 build: add macro to check the compiler flag support
Also, fold duplicate chunks together.
2016-05-18 20:53:51 +02:00
Lubomir Rintel
3b0dd0a55c trivial: rename compiler_warnings.m4 to compiler_options.m4
We'll use that for more compiler feature-checking macros.
2016-05-18 20:53:05 +02:00
Lubomir Rintel
84d90b71ae daemon: disable external visibility for nmdbus_* symbols
The generated code includes too much code that's not actually used.
LTO would drop it once it's not exported.
2016-05-18 20:53:05 +02:00
Lubomir Rintel
071b4fca61 build: prefer LTO-aware ar and ranlib
This actually fixes --with-lto.
2016-05-18 20:53:05 +02:00
Lubomir Rintel
5f849faa15 platform: fix the typedef-redefinition warnings
The configure script disabled the warning by accident.
2016-05-18 20:53:05 +02:00
Lubomir Rintel
85c92ff372 build: use the glib cflags when checking the compiler flags
Some of the checks include glib headers.
2016-05-18 20:52:36 +02:00
Beniamino Galvani
6280839c16 dns: merge branch 'bg/dnsmasq-interfaces-bgo765153'
https://bugzilla.gnome.org/show_bug.cgi?id=765153
2016-05-18 11:16:07 +02:00
Beniamino Galvani
b71e104d33 dns: specify egress interface for each dnsmasq upstream server
Currently we don't specify to dnsmasq which interface must be used to
contact a given nameserver and so requests can be sent through the
wrong interface.

Fix this by concatenating a @interface prefix to each server (unless
an IPv6 interface scope-id is already present).

https://bugzilla.gnome.org/show_bug.cgi?id=765153
2016-05-18 11:10:05 +02:00
Beniamino Galvani
027f4c65ac dns: assert early that @iface is not NULL
Under no circumstance should a non-global configuration with NULL or
empty iface be added to the DNS manager. Assert this early and remove
other unnecessary checks.
2016-05-18 11:10:05 +02:00
Thomas Haller
1f5c056700 man: describe logging domain "SYSTEMD" in man NetworkManager.conf 2016-05-17 19:57:55 +02:00
Thomas Haller
a2c843499c all/tests: split core part out of "nm-test-utils.h"
A large part of "nm-test-utils.h" is only relevant for tests inside "src/"
directory, as they are helpers related to NetworkManager core part.

Split this part out of "nm-test-utils.h" header.
2016-05-17 16:48:52 +02:00
Thomas Haller
65a254e03c trival: fix indention
Fixes: 5586ae80d1
2016-05-17 13:42:24 +02:00
Thomas Haller
1ad00095a1 wifi: refactor private data for NMAccessPoint
- make NMAccessPoint and NMAccessPointClass internal structs. This means,
  they cannot be subclassed anymore, but we also don't want that.

- This way, we can safely embed the private data directly in the now
  private access-point instance.

- change type of boolean fields from gboolean to bool.

- some whitespace fixes
2016-05-17 13:24:51 +02:00
Thomas Haller
5586ae80d1 wifi: refactor properties in NMAccessPoint using NM_GOBJECT_PROPERTIES_DEFINE() 2016-05-17 13:00:47 +02:00
Thomas Haller
54474993fd ifcfg-rh: merge branch 'th/ifcfg-rh-cleanup-bgo766518'
https://bugzilla.gnome.org/show_bug.cgi?id=766518
2016-05-17 12:26:35 +02:00
Thomas Haller
2d428bda35 ifcfg-rh: remove unused define ERR_GET_MSG() 2016-05-17 12:26:02 +02:00
Thomas Haller
4dcb5e5ba5 ifcfg-rh: cleanup includes
- don't include "nm-default.h" from headers. All source files
  include this header as first.

- drop G_BEGIN_DECLS/G_END_DECLS. This is not C++ nor public
  API.

- drop unnecessary includes from header files. They are either
  not required, or already provided via "nm-default.h".

- include in source files the corresponding header file as first
  after "nm-default.h". This should ensure that header files are
  self-contained (appart from "nm-default.h").
2016-05-17 12:25:55 +02:00
Thomas Haller
b503b37636 ifcfg-rh: don't print warning in svGetValueInt64()
Having a simple accessor print warnings is not nice. At that point there
is no context as to why we are trying to read the value.

Note that the function already handles and expects invalid values, it's
just not clear that printing warnings from a utility function is the right
thing to do.

Just ignore such cases silently (at this point). It's up to the caller
to print a warning or whatever.
2016-05-17 12:22:42 +02:00
Thomas Haller
f3bd778d6d ifcfg-rh: use _NMLOG() macro in writer
This gives every logging line a proper "ifcfg-rh" prefix.
But drop the "    " prefixes.
2016-05-17 12:22:42 +02:00
Thomas Haller
a519cc57b8 ifcfg-rh: use _NMLOG() macro in reader
This gives every logging line a proper "ifcfg-rh" prefix.
2016-05-17 12:22:42 +02:00
Thomas Haller
c949e1c429 ifcfg-rh: reject vlan id of value 4096
Maybe we should also reject 0 and 4095, but for now leave it.
2016-05-17 12:22:42 +02:00
Thomas Haller
a85c3db2f0 ifcfg-rh: use _nm_utils_ascii_str_to_int64() instead of strtol() 2016-05-17 12:22:42 +02:00
Thomas Haller
4b538ea8f1 ifcfg-rh: replace uses of get_int() 2016-05-17 12:22:42 +02:00
Thomas Haller
7328613d7b ifcfg-rh: don't use get_int() to parse MTU value
And print a warning also if the value is out of range.
2016-05-17 12:22:41 +02:00
Thomas Haller
ec639b5c63 ifcfg-rh: cast variadic arguments to proper int type 2016-05-17 12:22:41 +02:00
Thomas Haller
8e6d619c46 ifcfg-rh: use _nm_utils_ascii_str_to_int64() in reader's get_uint()/get_int() functions 2016-05-17 12:22:41 +02:00
Thomas Haller
25bf73292c device: merge branch 'th/device-rename-unmanaged-bgo766404'
https://bugzilla.gnome.org/show_bug.cgi?id=766404
2016-05-17 12:20:14 +02:00
Thomas Haller
7c785a064e device/trivial: rename nm_device_set_unmanaged_by_user_config() to nm_device_set_unmanaged_by_user_settings()
After all, it sets NM_UNMANAGED_USER_SETTINGS flag, so the name should
match with the flag.
2016-05-17 12:12:50 +02:00
Thomas Haller
0c4a23a438 device: update unamanged by user-config when device gets renamed
https://bugzilla.gnome.org/show_bug.cgi?id=766404
2016-05-17 12:06:36 +02:00
Thomas Haller
7961e1bb8a core: add nm_connection_provider_get_unmanaged_specs() 2016-05-17 11:54:08 +02:00
Beniamino Galvani
dbd0634c84 cli: append newline to failure message
Fixes: a06487a6ae
2016-05-16 17:55:21 +02:00
Thomas Haller
57a2aba0ea wwan: fix crash during nm_modem_deactivate()/disconnect_context_complete()
(gdb) bt
    #0  0x00007ffff4d9e075 in g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x-1, fundamental_type=fundamental_type@entry=80) at gtype.c:4030
    #1  0x00007ffff4d7e447 in g_object_unref (_object=0xffffffffffffffff) at gobject.c:3076
    #2  0x00007fffe89cdfa8 in disconnect_context_complete (ctx=ctx@entry=0x555555b4c680) at nm-modem-broadband.c:1062
    #3  0x00007fffe89cf6e5 in disconnect (modem=<optimized out>, warn=0, cancellable=0x0, callback=0x0, user_data=0x0) at nm-modem-broadband.c:1126
    #4  0x00007fffe89d24cd in nm_modem_deactivate (self=0x555555aba1b0 [NMModemBroadband], device=device@entry=0x555555ab8c20 [NMDeviceModem]) at nm-modem.c:1164
    #5  0x00007fffdbd73022 in deactivate (device=0x555555ab8c20 [NMDeviceModem]) at nm-device-modem.c:455
    #6  0x00005555555e087b in nm_device_cleanup (self=self@entry=0x555555ab8c20 [NMDeviceModem], reason=reason@entry=NM_DEVICE_STATE_REASON_NOW_MANAGED, cleanup_type=cleanup_type@entry=CLEANUP_TYPE_DECONFIGURE)
        at devices/nm-device.c:10392
    #7  0x00005555555e0ffd in _set_state_full (self=self@entry=0x555555ab8c20 [NMDeviceModem], state=state@entry=NM_DEVICE_STATE_UNAVAILABLE, reason=reason@entry=NM_DEVICE_STATE_REASON_NOW_MANAGED, quitting=quitting@entry=0) at devices/nm-device.c:10804
    #8  0x00005555555e1a16 in nm_device_state_changed (self=self@entry=0x555555ab8c20 [NMDeviceModem], state=state@entry=NM_DEVICE_STATE_UNAVAILABLE, reason=reason@entry=NM_DEVICE_STATE_REASON_NOW_MANAGED)
        at devices/nm-device.c:11029

Fixes: 21b50c59ce
2016-05-16 17:45:04 +02:00
Thomas Haller
f8fb670c6f platform: declare nmp_utils_ip_config_source_*() functions as const 2016-05-16 13:16:49 +02:00
Thomas Haller
5847e70fd6 shared: add _nm_pure/_nm_const define for __attribute__ ((pure))/((const)) 2016-05-16 13:09:02 +02:00
Beniamino Galvani
926ba925ec core: fix creation of NMSettingIPConfig routes
Since commit 4c2410bc92 ("platform: extend NMIPConfigSource to
preserve the rtm_protocol field") the rt_source field of a
NMPlatformIP{4,6}Route contains the RTPROT value read from
kernel. Update checks on route source, otherwise existing routes are
not picked up when a generated connection is created, breaking the
connection matching.

Fixes: 4c2410bc92
2016-05-16 12:06:55 +02:00
Thomas Haller
b871106e25 macros: define NM_MORE_ASSERTS is not defined
In NetworkManager's configure script we have --with-more-asserts
option which always defines NM_MORE_ASSERTS in config.h.

When reusing the header file outside of NetworkManager, the
NM_MORE_ASSERTS define might be unset. Define it in that case
to avoid compiler warnings about undefined preprocessor define.
2016-05-14 23:11:59 +02:00
Thomas Haller
dab2d46aa2 core: fix wrong rebase
Fixes: 25aaaab3b7
2016-05-13 19:28:04 +02:00
Dan Williams
25aaaab3b7 manager: don't unmanage devices without L3 config on shutdown
Use the following logic when quitting, if the device is managed:

  1) if the connection is assumed, leave it up
  2) if the device has no connection (eg, !req) leave it up
  3) if the device only has L2 leave it up

[thaller@redhat.com: original patch reworked by bgalvani@redhat.com and me]

https://bugzilla.redhat.com/show_bug.cgi?id=1311988
https://bugzilla.redhat.com/show_bug.cgi?id=1333983
2016-05-13 19:23:30 +02:00
Beniamino Galvani
fc8cc8393e dns: properly remove existing configurations
When a configuration is replaced by another with different metadata,
disconnect signals and clear @best_conf pointers. Also, the check in
remove_ip_config() was wrong.

Fixes: 8e6d442477
Fixes: 570d73979b
2016-05-13 17:46:09 +02:00
Thomas Haller
7d0119d249 man: minor rewording in NetworkManager.conf about connection.stop-match 2016-05-13 15:06:02 +02:00
Beniamino Galvani
3fdffab955 core: merge branch 'bg/disconnect-on-suspend-rh1330694-v2'
Let devices go through the disconnected state before sleeping so that
applications are notified of the change in connectivity and dispatcher
scripts are run.

https://bugzilla.redhat.com/show_bug.cgi?id=1330694
https://bugzilla.gnome.org/show_bug.cgi?id=748531
2016-05-13 14:42:14 +02:00