Commit Graph

13873 Commits

Author SHA1 Message Date
Dan Williams
9f6c81caa0 sd-dhcp6-client: fix off-by-two error in DUID length
The duid data passed by the client does not include the DUID type,
but client->duid_len does account for the size of the DUID type.
2014-11-06 21:36:02 -06:00
Dan Williams
b062632474 merge: automatic VPN reconnect support (bgo #349151) 2014-11-06 21:28:04 -06:00
Dan Williams
6cbbb9c0bb vpn: reconnect on service failures (bgo #349151)
Attempt to reconnect the VPN on failures, except when the underlying
device fails.

https://bugzilla.gnome.org/show_bug.cgi?id=349151
2014-11-06 21:17:34 -06:00
Dan Williams
b11798a196 vpn/core: move VPN gateway route between devices when routing changes 2014-11-06 21:17:34 -06:00
Dan Williams
1f544d337c vpn: allow plugins to indicate 'can-persist' capability
The plugin can indicate that this connection can persist across link
changes and other connectivity dropouts by passing this option
back in the SetConfig() calls.
2014-11-06 21:17:34 -06:00
Dan Williams
a966a5e8b5 vpn: allow plugins to re-enter the STARTING state to indicate reconnect
If the VPN re-enters the STARTING state to indicate that it has
disconnected from the VPN server and is trying to reconnect, change
the VPN connection's state to indicate that connectivity may be
limited.  Wait for the VPN to provide updated IP configuration
information from the reconnect to change back to the ACTIVATED
state.
2014-11-06 21:17:34 -06:00
Dan Williams
2b9e442013 libnm/libnm-util: add VPN 'persistent' property
This property will indicate that the user wishes the VPN connection
to stay active until explicitly disconnected, even across link changes
or other interruptions.
2014-11-06 21:16:57 -06:00
Dan Williams
4b2935b9b8 merge: fix libnm signal/ordering issues (bgo #738979) 2014-11-06 20:54:30 -06:00
Dan Williams
e5827729d6 trivial: make _nm_object_reload_properties() private to nm-object.c 2014-11-06 20:51:58 -06:00
Dan Williams
52ae28f6e5 libnm: queue added/removed signals and suppress uninitialized notifications
Property notifications are queued during object initialization and
reloading, but the added/removed signals were emitted immediately
even before the object was fully initialized.

Additionally, depending on how long asynchronous initialization took,
the notifications could have been emitted before the object was
fully initialized as deferred_notify_cb() wasn't being suppressed
until all the properties were complete.

For synchronous intialization, signals could be emitted at various
times during initialization and not all of the object's properties
may be read.  Furthermore property notifications were queued in an
idle handler, which breaks users that may not use a mainloop.  All
signals and notifications should be emitted immediately after
initialization is complete for synchronous initialization.

To make things consistent and ensure that all signals and notifications
are emitted only when initialization is complete, queue signals for
deferred emission and only run notifications/signals when all the
object's properties have been read.  For synchronous initialization,
emit all notifications and signals immediately after initialization
and not from an idle handler.
2014-11-06 20:51:58 -06:00
Dan Williams
0a0f9a3b4e trivial: re-arrange NMObject class methods
Move class-related and initialization interface related methods to
the bottom.
2014-11-06 20:51:58 -06:00
Dan Williams
648270d469 libnm: cancel NMRemoteSettings/NMManager property reload when NM quits
If the operation isn't canceled it returns an error, printing this:

/libnm/client-nm-running:
(/home/dcbw/Development/fdo/NetworkManager/libnm/tests/.libs/lt-test-nm-client:17983): libnm-WARNING **: updated_properties: error reading NMRemoteSettings properties: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
/bin/sh: line 5: 17983 Trace/breakpoint trap   ./libnm-test-launch.sh ${dir}$tst
FAIL: test-nm-client

which screws up testcases because they don't expect this message.
And in this case, since libnm knows that NM is exiting and will
just clear out the properties anyway, it's useless to print the message.
2014-11-06 20:51:58 -06:00
Jiří Klimeš
098d655ef1 cli: fix an error path in second level 'set' command of nmcli editor
Test case:
nmcli> goto ipv4.addresses
nmcli ipv4.addresses> set 1.1.1.1
Do you also want to set 'ipv4.method' to 'manual'? [yes]: no
nmcli ipv4.addresses> set 3.3.3.3/99
Error: failed to set 'addresses' property: invalid prefix '99'; <1-32> allowed
Do you also want to set 'ipv4.method' to 'manual'? [yes]:

The second question (after failed 'set') should not be asked.
2014-11-06 16:44:41 +01:00
Jiří Klimeš
32600a9035 cli: fix a regression in monitoring addresses vs. method changes
while editing an existing commention.
It was broken by commit 45590f809a that called
nm_connection_replace_settings_from_connection() which replaces settings with
connected signal handlers.
2014-11-06 12:47:17 +01:00
Thomas Haller
4b09f58555 nmcli/bash-completion: complete "help" for nmcli general status|permissions <TAB>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-11-06 10:38:18 +01:00
Thomas Haller
65b24725c5 nmcli/bash-completion: complete logging level "TRACE"
Fixes: bdea7d61d0
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-11-06 09:53:46 +01:00
Dan Williams
fb78b671d7 platform: fix lifetime/preferred type in _address_get_lifetime()
They are defined as gint32 but are assigned a guint32 value and
then immediately passed back to the caller of _address_get_lifetime()
as guint32.  They can never be negative, and may receive values
greater than G_MAXINT32, so they should be unsigned.
2014-11-05 12:44:59 -06:00
Lubomir Rintel
1b40c95c84 Revert "tui: additional fix for 'primary' option"
It makes no sense -- the primary option is specific to active-backup bonds; not
mandatory. It blocks validation and prvents using other options.

This reverts commit 37f12088e4.

https://bugzilla.redhat.com/show_bug.cgi?id=1142864
2014-11-04 10:11:06 +01:00
Lubomir Rintel
0276945fd3 cli: Activating an already activated connection fails
The new ActiveConnection starts in UNKNOWN state and we immediately assume
it failed. We should wait for DEACTIVATED or ACTIVATED instead.

https://bugzilla.gnome.org/show_bug.cgi?id=739339
2014-11-03 15:40:52 +01:00
Thomas Haller
b63f8c80f8 wimax/build: use NM_PRAGMA_WARNING_DISABLE() macro instead of #pragma
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 21:02:42 +01:00
Thomas Haller
e2179f0911 all: add macros to suppress compiler warnings
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 21:00:50 +01:00
Thomas Haller
b0e29b5bd3 doc: fix IGNORE_HFILES in libnm-glib
nm-dbus-helpers-private.h is a private header file to libnm-glib/.

nm-settings-connection-glue.h and nm-settings-glue.h are not part
of libnm-glib/, they are inside src/.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 18:59:33 +01:00
Thomas Haller
8b64b8012b doc: fix IGNORE_HFILES referencing non-existing *-bindings.h files
Fixes: 8ad3ff24ad
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 18:59:33 +01:00
Thomas Haller
119c0625af core: merge branch 'th/bgo738590_dhcp_server_route' (bgo #738590)
https://bugzilla.gnome.org/show_bug.cgi?id=738590

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 18:36:51 +01:00
Thomas Haller
3d7acbc427 dhcp: don't add special route to DHCP server when having direct route
When the DHCP server address is not on the same subnet, we used
to add a /32 route to the server IP address via the gateway.

Do not add this route, if we already got a direct route from DHCP.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-31 18:35:31 +01:00
Thomas Haller
ff145486d1 core: add nm_ipX_config_get_direct_route_for_host() functions
add two functions nm_ip4_config_get_direct_route_for_host()
and nm_ip6_config_get_direct_route_for_host() to check if we have
a direct (non-gw) route to a certain host.

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

https://bugzilla.gnome.org/show_bug.cgi?id=738590
2014-10-31 18:35:31 +01:00
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