Commit Graph

15047 Commits

Author SHA1 Message Date
Piotr Drąg
d5c192201a po: update Polish (pl) translation (bgo #765985)
https://bugzilla.gnome.org/show_bug.cgi?id=765985
2016-05-09 18:43:06 +02:00
Lubomir Rintel
9770024f63 dnsmasq: don't add router option for non-default-route connections
This is useful to set up a DHCP server, but don't hijack the default
route of the clients.
2016-05-09 12:33:38 +02:00
Thomas Haller
fbf4904ae0 nmtst: allow non-boolean argument to nmtst_assert_success()
Reimplement nmtst_assert_success() as a macro which allows non-boolean @success
arguments.
2016-05-09 11:04:51 +02:00
Thomas Haller
13ab20fe8c contrib/rpm: refactor specifying package version in spec file
Similar to what we do for RHEL and Fedora's spec file.
2016-05-06 15:54:19 +02:00
Shih-Yuan Lee (FourDollars)
831038a5c7 device: remove unnecessary object reference operations
Since commit 0175056a6d, it is unnecessary
to operate object reference when invoking g_idle_add so it is
unnecessary to operate object reference in GSourceFunc too.

Taking an additional reference to the device during update_ip_config()
was introduced by commit 6fba9fd2e5 to fix
a crash. It seems however the proper fix would have been commit
0175056a6d, to avoid any IP config
change events after disposing of the device starts.

https://mail.gnome.org/archives/networkmanager-list/2016-May/msg00002.html
https://mail.gnome.org/archives/networkmanager-list/2016-May/msg00009.html
2016-05-06 13:50:29 +02:00
Thomas Haller
0e7f93faea contrib/rpm: merge branch 'th/dispatcher-routing-rules' 2016-05-05 19:45:38 +02:00
Thomas Haller
a38aa2fdb2 contrib/rpm: make package "NetworkManager-dispatcher-routing-rules" as "BuildArch: noarch" 2016-05-05 19:43:32 +02:00
Thomas Haller
a447942fc0 contrib/rpm: rename package "NetworkManager-config-routing-rules" to "NetworkManager-dispatcher-routing-rules" 2016-05-05 19:25:53 +02:00
Thomas Haller
781e9603ca contrib/rpm: split "10-ifcfg-rh-routes.sh" script to NetworkManager-config-routing-rules package
Like we do on RHEL. The package-split was originally necessary because
installing a pre-up dispatcher script would block activation (even if there
were no relevant route files.

Even if we have now the no-wait.d/ directory for dispatchers, still
split the package. It makes sense to have the routing-rules in a
separate RPM.

For contrib/rpm, we don't properly obsolete an older version of
NetworkManager package and thus the upgrade path will be broken.
2016-05-05 19:18:45 +02:00
Beniamino Galvani
f1d23c32c3 docs: libnm: add doc comment to types
This is required to add objects in the "Types and Values" section and
in the API index. Later, we may want to add useful content in those
empty comments.
2016-05-05 17:01:57 +02:00
Beniamino Galvani
a51a43fc84 docs: libnm: add type headers to scan list
nm-core-types.h and nm-types.h contain the actual definition of types
and gtk-doc won't generate a "Implemented interfaces" section if they
are not included.

https://bugzilla.gnome.org/show_bug.cgi?id=765983
2016-05-05 17:01:45 +02:00
Beniamino Galvani
f57c205051 clients: add missing openvpn secret types to secret agent
Add support for asking a certificate password and a HTTP proxy
password for openvpn connections to the built-in secret agent.

https://bugzilla.gnome.org/show_bug.cgi?id=765553
2016-05-05 14:22:32 +02:00
Thomas Haller
0175056a6d device: disconnect platform signal handlers first in dispose
Once we start with dispose, we certainly don't want to process any platform
events for the device anymore.

Previously, we disconnect those handlers only later during dispose, so it's
not clear that we would not receive a device_ipx_changed signal after _cleanup_generic_pre().

Fix this possible (or actual) bug.
2016-05-05 12:19:20 +02:00
Thomas Haller
73cec4e912 device: don't cancel queued_ip4_config_id when scheduling activate_stage5_ip4_config_commit
Since commit a47c13a7a2, update_ip4_config() re-schedules
itself in case activate_stage5_ip4_config_commit is pending. Thus, there is no need to
cancel any queued queued_ip4_config_id.

Also as that does not properly fix the issue unlike a47c13a7a.
2016-05-05 12:04:09 +02:00
Thomas Haller
bac06c5ae6 device: ensure not rescheduling IP config changed on initial capture
update_ip4_config() and update_ip6_config() are called from nm_device_capture_initial_config().
At that point, we don't expect any activation-source scheduled, thus the "if" should not
not be hit anyway.

So, this patch should actually make no difference, but it seems clearer
to me. Also, because it would be a bug to re-schedule the idle handler
that is already pending, but from inspecting nm_device_capture_initial_config()
it is not immediately clear that this cannot be the case.
2016-05-05 11:24:54 +02:00
Thomas Haller
ec2a21702a device: add assertions for queued_ip4_config_change() and queued_ip6_config_change() 2016-05-05 11:10:33 +02:00
Thomas Haller
b6a92cbdc3 device: refactor clearing @queued_ip4_config_id and @queued_ip6_config_id 2016-05-05 10:58:10 +02:00
Thomas Haller
f5ae41656a device,cli: merge branch 'th/reapply-fixes-bgo765848'
https://bugzilla.gnome.org/show_bug.cgi?id=765848
2016-05-03 11:55:52 +02:00
Thomas Haller
7752f390c2 cli: declare external variable nm_cli in <nmcli.h> header 2016-05-03 11:53:15 +02:00
Thomas Haller
a9908c012c cli: remove unused functions 2016-05-03 11:53:15 +02:00
Thomas Haller
d742ea7817 cli: don't allow multiple <ifname> arguments to device-reapply
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.
2016-05-03 11:52:57 +02:00
Thomas Haller
b217b68b80 cli: refactor cleanup in do_device_reapply() 2016-05-03 11:52:40 +02:00
Thomas Haller
c71bd9df82 device: improve error message for failure to reapply 2016-05-03 11:52:40 +02:00
Thomas Haller
a51b947f25 device: fix check for invalid keys during reapply
Was completely wrong and failed to find first_invalid_key.
As a consequence, hit the assertion at the end.
2016-05-03 11:52:40 +02:00
Thomas Haller
b52d25e129 device: clear secrets from applied connection during reapply
The applied connection must have no secrets. It's unclear whether
there are any secrets at this point (possibly). To be sure, clear them.
2016-05-03 11:52:40 +02:00
Thomas Haller
ec840b0331 device: allow reapply with a different connection.uuid 2016-05-03 11:52:40 +02:00
Thomas Haller
ad38a1acb8 device: allow reapply if connection.id differs 2016-05-03 11:52:39 +02:00
Thomas Haller
05478e4f4c utils: refactor _nm_utils_ascii_str_to_int64()
To allow for trailing whitespace, we don't need to copy and trunacate
the input string. g_ascii_strtoll() conveniently returns the location via
the endptr argument.
2016-05-03 11:52:39 +02:00
Beniamino Galvani
904f840c20 device: merge branch 'bg/ip-method-fail-fixes-bgo741347'
https://bugzilla.gnome.org/show_bug.cgi?id=741347
2016-05-02 18:22:32 +02:00
Beniamino Galvani
f377e055bf device: add dhcp_schedule_restart() helper 2016-05-02 18:21:19 +02:00
Beniamino Galvani
cf4e2c7ab9 device: retry DHCPv6 when a lease expires
Make DHCPv6 more robust WRT temporary failures of servers by retrying
DHCP for a predefined number of times at regular intervals when the
lease expires.

https://bugzilla.gnome.org/show_bug.cgi?id=741347
2016-05-02 18:21:18 +02:00
Beniamino Galvani
ac52b95684 device: retry DHCPv4 when a lease expires
Make DHCPv4 more robust WRT temporary failures of servers by retrying
DHCP for a predefined number of times at regular intervals when the
lease expires.

https://bugzilla.gnome.org/show_bug.cgi?id=741347
2016-05-02 18:21:18 +02:00
Beniamino Galvani
363d5b33ec device: group DHCP6 private members 2016-05-02 18:21:18 +02:00
Beniamino Galvani
3f5ee827a9 device: group DHCP4 private members 2016-05-02 18:21:18 +02:00
Beniamino Galvani
b84768581e device: fail activation immediately only when may-fail=no
Introduce the nm_device_ip_method_failed() function to check if the
failure of an IP method should cause the activation to fail, and use
it where appropriate.

http://bugzilla.gnome.org/show_bug.cgi?id=741347
2016-05-02 18:21:18 +02:00
Beniamino Galvani
c0d322720a core: introduce nm_utils_dnsmasq_status_to_string() 2016-05-02 15:06:43 +02:00
Beniamino Galvani
d317709c10 dnsmasq-manager: trivial: remove unused signal slot 2016-05-02 15:06:43 +02:00
Beniamino Galvani
cce83f4f78 dnsmasq-manager: trivial: move class and object functions at bottom 2016-05-02 15:06:42 +02:00
Thomas Haller
c5ac691744 build: cleanup includes of <gmodule.h>
<gmodule.h> is implicitly included by <gio/gio.h> which is available
everywhere. For that reason, we would not have to include this header
at all. However, it is recommended to explicitly include <gmodule.h>
where needed.

So, include it where needed -- if <gio/gio.h> wouldn't be there --
and drop it from where it is not needed.
2016-04-30 03:42:16 +02:00
Thomas Haller
9f29cc13e7 man: clearify rc-manager symlink setting in NetworkManager.conf 2016-04-30 03:16:41 +02:00
Beniamino Galvani
a47c13a7a2 device: postpone updates of IP configuration when a commit is pending
When a new dynamic configuration is received, it is stored in a member
of private structure (e.g. @dhcp6_ip6_config) and a commit is
scheduled. Before the commit is executed, an update_ipx_config() could
be called and it would change the configuration before it is
committed.

This race condition causes failures in assigning the addresses
received through DHCPv6 when the internal client is used (but
potentially other clients and methods are affected).

To fix it, postpone updates of IP configurations when a commit is
already pending.
2016-04-29 17:16:25 +02:00
Thomas Haller
69863204e2 core,libnm: merge branch 'th/module-close' 2016-04-29 15:48:27 +02:00
Thomas Haller
c6a92224a4 settings: don't unload settings plugins on failure
Also, registering a weak-pointer to close the module that
was just made as resident is pointless.
2016-04-29 15:48:18 +02:00
Thomas Haller
cd39cbfc1f device: don't unload device plugins on failure 2016-04-29 15:41:41 +02:00
Thomas Haller
264189e756 libnm/vpn: don't close the VPN plugin library on cleanup
Closing the library will interfere badly as the glib types cannot be
unregistered. We must leak the library handle.

Switch to dlopen() instead of g_module_open(), because the former
supports RTLD_NOLOAD. This is useful for two reasons:

  - checking the file prior loading only makes any sense when
    dlopen() would actually load a file anew.

  - if the library was loaded before, we want to return the handle.
    On the other hand, if the library was not loaded, we leak the
    handle.

Thereby, refactor the code from if-else blocks to return-early, because
the function nicely does individual steps and if one fails just error
out.
2016-04-29 15:38:29 +02:00
Thomas Haller
b52485b34b libnm/vpn: fix checking service name in nm_vpn_plugin_info_new_search_file()
Fixes: 3adf782ab5
2016-04-29 15:28:04 +02:00
Lubomir Rintel
eafa6f725b systemd: fix conversion from size_t on s390
On s390 size_t is an unsigned long, not an unsigned int. They both are
of the same size and can be cast to each other safely, but the compiler
still seems unhappy about incompatible pointers.

https://github.com/systemd/systemd/pull/3147
2016-04-29 12:47:34 +02:00
Lubomir Rintel
76844c65d6 ifupdown: avoid calloc()
It can return NULL and makes Coverity upset:

CID 75369 (#1 of 1): Dereference null return value (NULL_RETURNS)
4.  dereference: Dereferencing a null pointer ret.
2016-04-29 12:47:34 +02:00
Lubomir Rintel
2e563d9c84 ifnet: fix error handling
CID 76722 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement:
g_set_error(error, nm_setti....
2016-04-29 12:47:34 +02:00
Lubomir Rintel
dc9bba9e51 config: call va_end() in unexpected code path too
CID 99747 (#1 of 1): Missing varargs init or cleanup (VARARGS)
13.  missing_va_end: va_end was not called for ap.
2016-04-29 12:47:34 +02:00