Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
22911696f4 core: add nm_utils_ip6_route_metric_normalize() function
Kernel treats IPv6 route metrics with value zero (0) special.
Add a utility function that helps accounting for that.

Signed-off-by: Thomas Haller <thaller@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=738590
2014-10-31 18:31:19 +01:00
Thomas Haller
0923769285 test,examples: fix scripts to avoid 'has_key' for Python 3
'has_key' on Dictionaries is removed from Python3 in favor of 'in'.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 16:39:00 +01:00
Lubomir Rintel
4f9e2e9603 libnm: Fix a nm_running_changed race
Unhook the nm_running_changed signal, so that it does not attempt to free
connections after they've been disposed already.

https://bugzilla.gnome.org/show_bug.cgi?id=739127
2014-10-31 15:44:31 +01:00
Lubomir Rintel
1f275a980a Merge branch 'lr/ap'
https://bugzilla.gnome.org/show_bug.cgi?id=738439
2014-10-31 15:35:20 +01:00
Lubomir Rintel
48b4f6f830 Merge branch 'lr/rpm-make-check'
https://bugzilla.gnome.org/show_bug.cgi?id=739127
2014-10-30 14:40:47 +01:00
Lubomir Rintel
9db55be9a1 contrib/rpm: Run make check 2014-10-30 14:39:08 +01:00
Lubomir Rintel
7ad8b8a358 tests: Fix /general/nm_utils_kill_child race
/general/nm_utils_kill_child: **
GLib:ERROR:test-general-with-expect.c:105:test_nm_utils_kill_child_sync_do: Did not see expected message NetworkManager-DEBUG: *kill child process 'test-s-1-1' (*): waiting up to 500 milliseconds for process to terminate normally after sending SIGTERM (15)...
Aborted

The first test case assumes the child does not go away immediately after being
delivered a TERM signal. Add some delay to its teardown code path, so that NM
will set up the timeout the test expects.
2014-10-30 14:39:08 +01:00
Lubomir Rintel
afbc2571a1 libnm/tests: Properly wait for devices in /libnm/activate-virtual
Ignore the signal if we're signalled before the second device is available and
wait for another one.
2014-10-30 14:39:08 +01:00
Thomas Haller
f4f3f4d69b core/logging: make log level and domain a C enum
This way the compiler issues a warning when accidently
switching the level and domain arguments when logging.

Make LOGD_ALL and LOGD_DEFAULT members of the enum instead
defining them. Previously the LOGD_ALL define included all
the defined domains, hence this is no functional change.

Also define the logging domain aliases as enum members (instead
of preprocessor defines).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-30 14:18:16 +01:00
Thomas Haller
4e404212fc core/logging: adjust numerical values of the logging domain flags
The numerical value 0x01 was unused. Shift all the values
to fill the "hole".

Fixes: 552ed76f59
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-30 12:45:30 +01:00
Jiří Klimeš
85fcfd1fa7 merge: show connection secrets in nmcli when required (bgo #737415)
Secrets will be displayed when '--show-secrets' is used for 'nmcli con show',
or nmcli> nmcli show-secrets yes in the editor.
2014-10-30 09:27:01 +01:00
Jiří Klimeš
45590f809a cli: allow showing secrets in the editor 2014-10-30 09:18:01 +01:00
Jiří Klimeš
b4e013abed cli: display '<hidden>' string for secret properties
unless the user explicitly say to show them.
2014-10-30 09:18:01 +01:00
Thomas Haller
2a40acc67d cli/bash-completion: update bash completion for '--show-secrets' option 2014-10-30 09:17:34 +01:00
Jiří Klimeš
1a64683802 cli: add '--show-secrets' option for 'nmcli connection show'
It can be used to display connection secrets (passwords).  When used, it will
get secrets for the connection profile and merge it into the connection's
settings before displaying it.

Example:
nmcli con show -s hotel-wifi
2014-10-30 09:11:43 +01:00
Jiří Klimeš
ab81e9b826 merge: allow connection normalization in nmcli editor (rh #1157164)
- introduce 'verify fix' command in the editor for normalizing the connection
- check IP settings when connection.master property is changed and offer their
  removal (slaves are not allowed to have IP configuration)
2014-10-30 08:40:32 +01:00
Jiří Klimeš
f558c8a51e cli: add 'verify fix' command for nmcli connection editor
Some connection verification errors are normalizable by NetworkManager. So we
can allow users to normalize the connection using one command.
2014-10-30 08:31:54 +01:00
Jiří Klimeš
d31c456033 cli: check IP configuration when setting connection.master in editor
If IPv4 and/or IPv6 are present on setting connection.master, offer their
removal.
2014-10-30 08:30:48 +01:00
Jiří Klimeš
afde052445 trivial: fix a typo in comments 2014-10-30 08:25:11 +01:00
Dan Winship
ed227ad8a3 libnm-core, libnm: introspection annotation fixes
A parenthesized comment in nm-dbus-interface.h was being misparsed as
an annotation.

The annotations on NMDhcp4Config:options and NMDhcp6Config:options
were incorrect.
2014-10-29 10:45:40 -04:00
Thomas Haller
069fcf4ba3 settings: merge branch 'th/bgo738611_load_setting_plugins' (bgo #738611)
buil://bugzilla.gnome.org/show_bug.cgi?id=738611

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:27:57 +01:00
Thomas Haller
b7d6e44f3c settings: check file permissions when loading settings plugins
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:19:15 +01:00
Thomas Haller
b2123a397a settings: accept missing settings plugins
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:19:15 +01:00
Thomas Haller
4545b6cb1e config: set a compile time default for the main.plugins configuration option
In case of a missing NetworkManager.conf (or a missing configuration option
main.plugins), allow to determine the fallback at compile time

https://bugzilla.gnome.org/show_bug.cgi?id=738611

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:17:55 +01:00
Thomas Haller
99c9529b15 build: add configure option for ibft plugin
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:17:55 +01:00
Thomas Haller
f77b8460d0 man: add description for ibft settings plugin to NetworkManager.conf
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:17:55 +01:00
Thomas Haller
caa1779f33 utils: fix printf format for pid_t in nm_utils_get_start_time_for_pid()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 15:02:04 +01:00
Dan Winship
ace746df4e platform: deal with default route being passed to route_sync() (bgo 735325)
NMIP4Configs and NMIP6Configs are never supposed to contain a default
route, and thus nm_platform_ip6_route_sync() should never have to deal
with one. Unfortunately, if it *does* get passed a default route, it
will add it even if it was already there. This will result in an
RTM_NEWROUTE notification, which will cause NMPlatform to emit
ip6-route-changed, which will result in NMDevice doing some work and
then calling nm_ip6_config_commit(), which will result in NMIP6Config
passing the same list of routes to nm_platform_ip6_route_sync() again,
including the default route, which will cause NMPlatform to add the
route again...

(Something eventually causes this cycle to get broken, but it starts
up again the next time NM receives an RA.)

Fix this by having the route_sync() functions never add/modify the
default route (They were already not deleting it.)
2014-10-29 09:14:03 -04:00
Dan Winship
9f739d0c61 rdisc: properly handle RDNSS/DNSSL forced expiration
If the router sends an RA with an RDNSS or DNSSL lifetime of "0", that
means to immediately stop using the corresponding server/domain name.
NMLNDPRDisc knew this, but messed up its handling of it, and so if
this happened, it might end up sending out an RS to get new data every
0 seconds...

(Noticed while investigating bgo 735325, though it turned out to be
irrelevant there.)
2014-10-29 09:13:36 -04:00
Thomas Haller
f1a0b4afd2 build: renable -Wstrict-prototypes compiler warning
The warning -Wstrict-prototypes was disabled by commit
db9b1df0e4 .

Enable it again, but avoid warnings for WiMax SDK by explicitly disabling the
compiler warning where needed.

Apparently clang does not produce a warning for -Wstrict-prototypes,
hence we don't need a clang specific #pragma.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 14:09:52 +01:00
Thomas Haller
dd243ceefe build: refactor compiler_warnings.m4 macro
NM_COMPILER_WARNINGS still works the same, but
rename variables to have a CFLAGS_* prefix.

Also cleanup the construction of CFLAGS by appending
to CFLAGS_MORE_WARNINGS variable instead of appending
to CFLAGS, and resetting to SAVE_CFLAGS.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:40:03 +01:00
Thomas Haller
b77567b225 build: fix -Wstrict-prototypes warnings
We disabled -Wstrict-prototypes in commit
db9b1df0e4 .
Fix compiler warnings.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:30:11 +01:00
Lubomir Rintel
5aefbe5658 libnm-core: Don't warn on missing properties
It might simply mean that the object disappeared (which is perfectly fine):

(process:7680): libnm-WARNING **: Could not fetch property 'Vpn' of interface 'org.freedesktop.NetworkManager.Connection.Active' on /org/freedesktop/NetworkManager/ActiveConnection/151: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

https://bugzilla.gnome.org/show_bug.cgi?id=739255
2014-10-29 10:04:52 +01:00
Josef Andersson
bd2829f355 po: update Swedish (sv) translation (bgo #739304)
https://bugzilla.gnome.org/show_bug.cgi?id=739304

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 09:36:27 +01:00
Colin Walters
6d1912ff2e callouts: Mark nmdbus-dispatcher.[ch] as BUILT_SOURCES
Otherwise we might hit race conditions during build.
2014-10-28 17:50:24 -04:00
Dan Winship
85030d9131 libnm-core, libnm: remove GSLists in APIs (bgo #739023) 2014-10-28 17:23:51 -04:00
Dan Winship
6ae4224850 libnm: change GSList to GPtrArray in libnm methods
libnm mostly used GPtrArrays in its APIs, except that arrays of
connections were usually GSLists. Fix this and make them GPtrArrays
too (and rename nm_client_list_connections() to
nm_client_get_connections() to match everything else).
2014-10-28 17:17:17 -04:00
Dan Winship
9e5c7d915b libnm-core: make nm_setting_verify() take an NMConnection
nm_setting_verify() took a GSList of other NMSettings, but really it
would just be simpler all around to pass the NMConnection instead...

This means that several formerly NMSetting-branded functions that
operated on lists-of-settings now get replaced with
NMConnection-branded functions instead.
2014-10-28 17:17:17 -04:00
Dan Winship
b108790833 libnm-core: add nm-core-types.h, remove cross-includes
Add nm-core-types.h, typedefing all of the GObject types in
libnm-core; this is needed so that nm-setting.h can reference
NMConnection in addition to nm-connection.h referencing NMSetting.

Removing the cross-includes from the various headers causes lots of
fallout elsewhere. (In particular, nm-utils.h used to include
nm-connection.h, which included every setting header, so any file that
included nm-utils.h automatically got most of the rest of libnm-core
without needing to pay attention to specifics.) Fix this up by
including nm-core-internal.h from those files that are now missing
includes.
2014-10-28 17:17:17 -04:00
Dan Winship
6eba3aa141 libnm-core: #include all nm-core headers from nm-core-internal.h
The nm-core headers are all interconnected, and most .c files don't
include every header they need. As a prologue to making them less
interconnected, include everything from nm-core-internal.h, to make
it easier to fix up all the breakage.
2014-10-28 17:17:17 -04:00
Dan Winship
8c368a51ba libnm-core: hwaddr-related fixes (bgo 739023) 2014-10-28 17:08:54 -04:00
Dan Winship
b084ad7f2b libnm-core: canonicalize hardware addresses in settings
Convert hardware addresses to canonical form (uppercase, leading
zeros, colons) when setting them on/adding them to NMSetting
properties.
2014-10-28 17:08:46 -04:00
Dan Winship
61e489a736 libnm-core: add nm_utils_hwaddr_canonical()
Add a helper function for converting hardware addresses to canonical
form.
2014-10-28 17:08:46 -04:00
Dan Winship
dfcb221337 libnm-core: make _get_mac_address_blacklist() methods return arrays
Make nm_setting_wired_get_mac_address_blacklist() and
nm_setting_wireless_get_mac_address_blacklist() return a char**,
rather than a GSList.
2014-10-28 17:08:46 -04:00
Dan Winship
af3d604e4f po: fix up for NMVpnPlugin rename 2014-10-28 17:07:42 -04:00
Dan Winship
650d09baa3 libnm: rename NMVpnPlugin (bgo #739072) 2014-10-28 14:50:27 -04:00
Dan Winship
4d9cbaf9bf libnm: merge nm-vpn-plugin-utils into nm-vpn-plugin-old
The new VPN plugin API will hopefully simplify some the the tasks that
are currently handled by nm-vpn-plugin-utils functions, so make those
functions explicitly be part of the "old" API. (If we still want them
in the new API we can just move them back out, and have the "_old_"
versions just be wrappers around the undeprecated ones.)
2014-10-28 14:50:27 -04:00
Dan Winship
f452606020 libnm: rename NMVpnPlugin to NMVpnPluginOld
Rename libnm's NMVpnPlugin to NMVpnPluginOld, in preparation for
having a new-and-improved NMVpnPlugin in NM 1.2. Also remove it from
NM-1.0.gir.

Make nm-vpn-plugin-old.h be separately includable, since it's not
included from NetworkManager.h, and we probably don't want it to be.

Remove NMVpnPlugin, NMVpnPluginUiInterface, and nm-vpn-plugin-utils
from the docs, since they're basically undocumented anyway.
2014-10-28 14:50:27 -04:00
Dan Winship
1e9c5f415f libnm-core: fix trivial bug in NMVpnPluginError quark 2014-10-28 14:50:27 -04:00
Dan Williams
e01e43cd2f dhcp: suppress warning about invalid DNS servers
If the DHCP server happens to send "0.0.0.0", which you see with
some consumer gear that only has one nameserver set, don't warn
because we know it's bogus.

Also rename the copy & pasted 'searches' variable to what it's
actually used for.
2014-10-27 15:54:30 -05:00