summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* device: re-read carrier-detect capability after bringing device upth/device-carrier-cap-bgo766179Thomas Haller2016-05-121-0/+8
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=766179
* fixup! device: fix multiple subscriptions to config-changed signal for ↵Thomas Haller2016-05-121-5/+3
| | | | ignore-carrier
* device: fix multiple subscriptions to config-changed signal for ignore-carrierThomas Haller2016-05-121-9/+14
| | | | | | | | | | | | We would subscribe to config-changed signal during object-realize, however only unsubscribe during dispose(). Avoid multiple subscributions, and unsubscribe also when unrealizing the device. Also, always subscribe to the signal, even without capability NM_DEVICE_CAP_CARRIER_DETECT. In the next commit, we will re-read capabilities later on, so just always subscribe.
* device: don't check_carrier() during bring_up()Thomas Haller2016-05-121-4/+4
| | | | Don't check the carrier state inside the virtual function bring_up().
* device: add function to change device capabilitesThomas Haller2016-05-121-4/+16
|
* device: use "bool" type for fields in NMDeviceThomas Haller2016-05-121-19/+19
| | | | | | | | | | | | | | | Contrary to gboolean, bool is only one byte in size. Due to alignment and ordering of the fields, this saves merely 16 bytes per NMDevicePrivate struct (on x86_64), still. Also, bool is coerced by the compiler to be strictly FALSE or TRUE -- contrary to gboolean, which can be any integer. Thus, for bool type, "g_assert (NM_IN_SET (value, FALSE, TRUE));" never fails. That is desirable as well. While not a large win, it seems favorable to use bool type for fields of a struct.
* config/tests: use absolute path for config testThomas Haller2016-05-121-2/+2
| | | | | | | | | Otherwise, calling ./src/tests/config/test-config fails, and we must do: (cd ./src/tests/config && ./test-config) We can avoid that easily.
* WIPThomas Haller2016-05-121-0/+34
|
* wwan: inline disconnect_context_complete_if_cancelled() checkThomas Haller2016-05-121-16/+7
| | | | | This function is only used once, and it actually is more confusing instead of directly seeing in disconnect() what happens.
* wwan: cancel asyncronous request in connect_context_clear()Thomas Haller2016-05-121-2/+2
| | | | | | | | | | | priv->ctx->cancellable is passed to mm_sim_send_pin() to cancel the operation. We must cancel the operation when the context/response is no longer relevant. Especially, as we don't take a reference on @self during the asyncronous request.
* auth: embed private data NMAuthSubjectPrivate in NMAuthSubject structThomas Haller2016-05-122-22/+34
| | | | | | | | | | | | | | ... and make the structs NMAuthSubject and NMAuthSubjectClass opaque types. I don't want to do this for all our types, only for a few prominent GObject instances that we create a lot and that are really not expected to ever be subclassed. NMAuthSubject is such a candidate. It is really a very simple object containing a few information bits about the authentication request. It is not ever expected to be extended/inherited or become more complex. No need to do a full-fledged private-data implementation.
* core: preserve const-ness in NM_IP4_CONFIG_GET_PRIVATE()Thomas Haller2016-05-122-73/+87
| | | | | | | | | | | | | | | | | Usually, our _GET_PRIVATE() macros cast away the const-ness of the self argument -- also because they cannot do any better in plain (gcc) C. Now it is possible to preserve const-ness, it seems more correct to do so. After all, the const should also help us not modifying arguments that are not intended to be modified. Although, the more important use of const is to signal that a function promises not to modify an argument, like in memcpy(void*,const void*) it's immediately clear which is source and destination. In C, a const is anyway not enforcable, but can show intent. Likewise for NM_IP6_CONFIG_GET_PRIVATE() and NMIP6Config.
* shared: add define _nm_unused for __attribute__((unused))Thomas Haller2016-05-121-0/+1
| | | | | This is both supported by clang and gcc. Using it is nicer then casting the (void), which requires an additional line of code.
* session-monitor: remove wrapper functions to connect/disconnect signalThomas Haller2016-05-123-52/+7
| | | | | | | | We don't add such wrappers anywhere else, and I think they are not desired style. Also, keep the signal-id in a "gulong session_changed_id", instead of guint.
* core: make NMIP4Config struct private and directly embed private dataThomas Haller2016-05-114-46/+43
| | | | | | | | | | | | | | | | | | | With GObject, the object structure and class structure must be public to be able to inherit from the type. As NMIP4Config is not inherited (final), we don't need that and we don't expect ever needing that for this type. Already now, we want to have the priv pointer directly accessible via self->priv. The main reason is improved debugging, another reason is faster lookup. Now with the struct private, we can directly embed the private data inside NMIP4Config. This avoids storing the private data outside separately inside the GObject which involves a small overhead. It becomes more attractive to do so, as every NMDevice has a multitude of these NMIP4Config instances. And likewise for NMIP6Config.
* sd/dhcp: workaround multiple "Domain Name" (option 15) entriesThomas Haller2016-05-111-2/+3
| | | | | | https://mail.gnome.org/archives/networkmanager-list/2005-April/msg00022.html https://tools.ietf.org/html/rfc2132#section-3.17 https://bugzilla.gnome.org/show_bug.cgi?id=766191
* po: update Simplified Chinese (zh_CN) translation (bgo #765787)Mingye Wang (Arthur2e5)2016-05-101-3564/+3235
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=765787
* po: update Brazilian Portuguese (pt_BR) translation (bgo#765974)Rafael Fontenelle2016-05-101-950/+1004
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=765974
* wwan: return from send_pin_ready() when operation cancelled and fix leakThomas Haller2016-05-101-2/+4
| | | | | | | | | | | We call the asynchrnous function mm_sim_send_pin() without taking a reference on @self. During send_pin_ready() we must first check whether the request was cancelled because self might be a dangling pointer at this point. Also, avoid leaking @error if the ctx is no longer valid. Fixes: aa0b379699fe8cb4ec9ef28fc493c0e499c892d8
* device: remove pending dhcp actions also in IP_DONE stateBeniamino Galvani2016-05-101-0/+4
| | | | | | | | | When the IP status is IP_DONE and a DHCP transaction succeeds the 'dhcp4' and 'dhcp6' pending actions must be removed. Without this, a temporary link loss just after the activation would cause a DHCP restart and those actions would remain set, blocking the startup. https://bugzilla.redhat.com/show_bug.cgi?id=1330893
* modem: clear the connection context on device disconnectionLubomir Rintel2016-05-102-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the device is disconnected, we should also disconnect the modem; and while we disconnect the device we should clean the connection context. Otherwise the modem will surprise us by emitting PREPARED signal when the device is no longer PREPARED: NetworkManager[28469]: <info> [1462383185.8714] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested) NetworkManager[28469]: <info> [1462383185.8715] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested) NetworkManager[28469]: <info> [1462383185.8716] device (ttyACM1): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38] NetworkManager[28469]: <info> [1462383185.8759] (ttyACM1): modem state changed, 'connecting' --> 'disconnecting' (reason: user-requested) NetworkManager[28469]: <warn> [1462383185.8937] (ttyACM1): failed to connect modem: Dial operation has been cancelled (NetworkManager:28469): NetworkManager-wwan-CRITICAL **: modem_prepare_result: assertion 'state == NM_DEVICE_STATE_PREPARE' failed Program received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=0x7fffea31bc47 "NetworkManager-wwan", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcfc0) at gmessages.c:1086 1086 g_private_set (&g_log_depth, GUINT_TO_POINTER (depth)); (gdb) bt #0 0x00007ffff4ebe643 in g_logv (log_domain=0x7fffea31bc47 "NetworkManager-wwan", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcfc0) at gmessages.c:1086 #1 0x00007ffff4ebe7bf in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1119 Python Exception <type 'exceptions.RuntimeError'> Cannot locate object file for block.: #2 0x00007ffff2ce6dac in ffi_call_unix64#3 0x00007ffff2ce66d5 in ffi_call (cif=cif@entry=0x7fffffffd300, fn=<optimized out>, rvalue=0x7fffffffd230, avalue=avalue@entry=0x7fffffffd1d0) at ../src/x86/ffi64.c:522 #4 0x00007ffff51b55a5 in g_cclosure_marshal_generic_va (closure=0x555555b30cb0, return_value=0x0, instance=0x555555a8d360, args_list=<optimized out>, marshal_data=0x0, n_params=2, param_types=0x555555c2bb60) at gclosure.c:1600 #5 0x00007ffff51b4b37 in _g_closure_invoke_va (closure=closure@entry=0x555555b30cb0, return_value=return_value@entry=0x0, instance=instance@entry=0x555555a8d360, args=args@entry=0x7fffffffd5b8, n_params=2, param_types=0x555555c2bb60) at gclosure.c:864 #6 0x00007ffff51ce117 in g_signal_emit_valist (instance=instance@entry=0x555555a8d360, signal_id=signal_id@entry=168, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd5b8) at gsignal.c:3292 #7 0x00007ffff51cf2e8 in g_signal_emit_by_name (instance=instance@entry=0x555555a8d360, detailed_signal=detailed_signal@entry=0x7fffea074cdd "prepare-result") at gsignal.c:3479 #8 0x00007fffea011fd3 in connect_context_step (self=self@entry=0x555555a8d360 [NMModemBroadband]) at nm-modem-broadband.c:529 #9 0x00007fffea01264d in connect_ready (simple_iface=<optimized out>, res=<optimized out>, self=0x555555a8d360 [NMModemBroadband]) at nm-modem-broadband.c:378 #10 0x00007ffff546a297 in g_simple_async_result_complete (simple=0x7fffe00104e0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801 #11 0x00007fffe9d82fec in connect_context_complete_and_free (ctx=ctx@entry=0x555555c52f60) at mm-modem-simple.c:93 #12 0x00007fffe9d83155 in simple_connect_ready (self=0x7fffdc00b9f0 [MMModemSimple], res=0x7fffdc004410, ctx=0x555555c52f60) at mm-modem-simple.c:159 #13 0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004410 [GTask]) at gtask.c:1106 #14 0x00007ffff547b62e in g_task_return (task=0x7fffdc004410 [GTask], type=<optimized out>) at gtask.c:1164 #15 0x00007ffff54d4239 in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x7fffdc004410) at gdbusproxy.c:2570 #16 0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004340 [GTask]) at gtask.c:1106 #17 0x00007ffff547b62e in g_task_return (task=0x7fffdc004340 [GTask], type=<optimized out>) at gtask.c:1164 #18 0x00007ffff54c8c9f in g_dbus_connection_call_done (source=<optimized out>, result=0x555555a60920, user_data=0x7fffdc004340) at gdbusconnection.c:5702 #19 0x00007ffff547af93 in g_task_return_now (task=0x555555a60920 [GTask]) at gtask.c:1106 #20 0x00007ffff547afc9 in complete_in_idle_cb (task=0x555555a60920) at gtask.c:1120 #21 0x00007ffff4eb7d7a in g_main_context_dispatch (context=0x555555a4a000) at gmain.c:3152 #22 0x00007ffff4eb7d7a in g_main_context_dispatch (context=context@entry=0x555555a4a000) at gmain.c:3767 #23 0x00007ffff4eb80b8 in g_main_context_iterate (context=0x555555a4a000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838 #24 0x00007ffff4eb838a in g_main_loop_run (loop=0x555555a48780) at gmain.c:4032 #25 0x00005555555aebf2 in main (argc=1, argv=0x7fffffffdc48) at main.c:477 (gdb)
* modem-broadband: ignore late callbacksLubomir Rintel2016-05-101-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If libmm invokes callbacks after the connect context has been disposed we should just ignore them. Fixes crash on dereferencing already freed connect context (due to explicit disconnection while the modem is connecting): NetworkManager[29074]: <info> [1462383917.8718] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested) NetworkManager[29074]: <info> [1462383917.8719] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested) NetworkManager[29074]: <info> [1462383917.8720] device (ttyACM1): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38] NetworkManager[29074]: <info> [1462383917.8758] (ttyACM1): modem state changed, 'connecting' --> 'disconnecting' (reason: user-requested) NetworkManager[29074]: <warn> [1462383917.8909] (ttyACM1): failed to connect modem: Dial operation has been cancelled (NetworkManager:29074): NetworkManager-wwan-CRITICAL **: modem_prepare_result: assertion 'state == NM_DEVICE_STATE_PREPARE' failed NetworkManager[29074]: <info> [1462383917.8912] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested) NetworkManager[29074]: <info> [1462383917.8913] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested) NetworkManager[29074]: <info> [1462383917.9693] (ttyACM1): modem state changed, 'connecting' --> 'registered' (reason: user-requested) Program received signal SIGSEGV, Segmentation fault. connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329 329 if (!ctx->first_error) { (gdb) bt #0 0x00007fffea01272a in connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329 #1 0x00007ffff546a297 in g_simple_async_result_complete (simple=0x7fffe0009200 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801 #2 0x00007fffe9d82fec in connect_context_complete_and_free (ctx=ctx@entry=0x7fffdc00c550) at mm-modem-simple.c:93 #3 0x00007fffe9d83155 in simple_connect_ready (self=0x7fffdc00c960 [MMModemSimple], res=0x555555a7c2b0, ctx=0x7fffdc00c550) at mm-modem-simple.c:159 #4 0x00007ffff547af93 in g_task_return_now (task=0x555555a7c2b0 [GTask]) at gtask.c:1106 #5 0x00007ffff547b62e in g_task_return (task=0x555555a7c2b0 [GTask], type=<optimized out>) at gtask.c:1164 #6 0x00007ffff54d4239 in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x555555a7c2b0) at gdbusproxy.c:2570 #7 0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004470 [GTask]) at gtask.c:1106 #8 0x00007ffff547b62e in g_task_return (task=0x7fffdc004470 [GTask], type=<optimized out>) at gtask.c:1164 #9 0x00007ffff54c8c9f in g_dbus_connection_call_done (source=<optimized out>, result=0x7fffe00036f0, user_data=0x7fffdc004470) at gdbusconnection.c:5702 #10 0x00007ffff547af93 in g_task_return_now (task=0x7fffe00036f0 [GTask]) at gtask.c:1106 #11 0x00007ffff547afc9 in complete_in_idle_cb (task=0x7fffe00036f0) at gtask.c:1120 #12 0x00007ffff4eb7d7a in g_main_context_dispatch (context=0x555555a4a000) at gmain.c:3152 #13 0x00007ffff4eb7d7a in g_main_context_dispatch (context=context@entry=0x555555a4a000) at gmain.c:3767 #14 0x00007ffff4eb80b8 in g_main_context_iterate (context=0x555555a4a000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838 #15 0x00007ffff4eb838a in g_main_loop_run (loop=0x555555a48780) at gmain.c:4032 #16 0x00005555555aebf2 in main (argc=1, argv=0x7fffffffdc78) at main.c:477 (gdb)
* po: update Polish (pl) translation (bgo #765985)Piotr Drąg2016-05-091-766/+766
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=765985
* dnsmasq: don't add router option for non-default-route connectionsLubomir Rintel2016-05-091-6/+10
| | | | | This is useful to set up a DHCP server, but don't hijack the default route of the clients.
* nmtst: allow non-boolean argument to nmtst_assert_success()Thomas Haller2016-05-091-7/+5
| | | | | Reimplement nmtst_assert_success() as a macro which allows non-boolean @success arguments.
* contrib/rpm: refactor specifying package version in spec fileThomas Haller2016-05-062-3/+11
| | | | Similar to what we do for RHEL and Fedora's spec file.
* device: remove unnecessary object reference operationsShih-Yuan Lee (FourDollars)2016-05-061-5/+0
| | | | | | | | | | | | | | | Since commit 0175056a6d70bafdaf1042eb8f5e1ef57484a3f2, 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 6fba9fd2e55216ba12c77e4567c48d79289cc9b7 to fix a crash. It seems however the proper fix would have been commit 0175056a6d70bafdaf1042eb8f5e1ef57484a3f2, 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
* contrib/rpm: merge branch 'th/dispatcher-routing-rules'Thomas Haller2016-05-051-3/+17
|\
| * contrib/rpm: make package "NetworkManager-dispatcher-routing-rules" as ↵Thomas Haller2016-05-051-0/+1
| | | | | | | | "BuildArch: noarch"
| * contrib/rpm: rename package "NetworkManager-config-routing-rules" to ↵Thomas Haller2016-05-051-5/+7
| | | | | | | | "NetworkManager-dispatcher-routing-rules"
| * contrib/rpm: split "10-ifcfg-rh-routes.sh" script to ↵Thomas Haller2016-05-051-3/+14
|/ | | | | | | | | | | | | | | 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.
* docs: libnm: add doc comment to typesBeniamino Galvani2016-05-0568-3/+204
| | | | | | 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.
* docs: libnm: add type headers to scan listBeniamino Galvani2016-05-051-2/+0
| | | | | | | | 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
* clients: add missing openvpn secret types to secret agentBeniamino Galvani2016-05-051-2/+7
| | | | | | | 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
* device: disconnect platform signal handlers first in disposeThomas Haller2016-05-051-4/+4
| | | | | | | | | | 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.
* device: don't cancel queued_ip4_config_id when scheduling ↵Thomas Haller2016-05-051-3/+0
| | | | | | | | | | activate_stage5_ip4_config_commit Since commit a47c13a7a2cd66644adf2459690f9c3bb96235ab, 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.
* device: ensure not rescheduling IP config changed on initial captureThomas Haller2016-05-051-6/+8
| | | | | | | | | | | 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.
* device: add assertions for queued_ip4_config_change() and ↵Thomas Haller2016-05-051-4/+14
| | | | queued_ip6_config_change()
* device: refactor clearing @queued_ip4_config_id and @queued_ip6_config_idThomas Haller2016-05-051-27/+9
|
* device,cli: merge branch 'th/reapply-fixes-bgo765848'Thomas Haller2016-05-0310-199/+75
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=765848
| * cli: declare external variable nm_cli in <nmcli.h> headerThomas Haller2016-05-035-18/+2
| |
| * cli: remove unused functionsThomas Haller2016-05-032-74/+0
| |
| * cli: don't allow multiple <ifname> arguments to device-reapplyThomas Haller2016-05-032-51/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * cli: refactor cleanup in do_device_reapply()Thomas Haller2016-05-031-10/+7
| |
| * device: improve error message for failure to reapplyThomas Haller2016-05-031-7/+14
| |
| * device: fix check for invalid keys during reapplyThomas Haller2016-05-031-7/+3
| | | | | | | | | | Was completely wrong and failed to find first_invalid_key. As a consequence, hit the assertion at the end.
| * device: clear secrets from applied connection during reapplyThomas Haller2016-05-031-0/+1
| | | | | | | | | | The applied connection must have no secrets. It's unclear whether there are any secrets at this point (possibly). To be sure, clear them.
| * device: allow reapply with a different connection.uuidThomas Haller2016-05-031-0/+6
| |
| * device: allow reapply if connection.id differsThomas Haller2016-05-031-0/+1
| |
| * utils: refactor _nm_utils_ascii_str_to_int64()Thomas Haller2016-05-031-35/+12
|/ | | | | | 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.