summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core: add a framework for tracking devicesdanw/wip/trackdevicedanw/trackdeviceDan Winship2014-02-263-131/+196
| | | | | | Some devices need to track the presence/creation/destruction of other devices. Add nm_manager_track_device() to simplify this, and port NMDeviceOlpcMesh to use it for tracking its companion wifi device.
* platform, devices: add support for vxlan devicesDan Winship2014-02-2612-0/+774
| | | | | | Since vxlan is new-ish, and vxlan IPv6 support in particular has only been in the kernel since 3.11, this code is conditional on having new enough kernel headers.
* devices: fix up parent/peer tracking in some virtual devicesDan Winship2014-02-263-19/+21
| | | | | | | | | | | | | | | | | | NMDeviceGre and NMDeviceMacvlan didn't deal with the possibility that the virtual device might be created before its parent's NMDevice is created. Mostly fix this by having them put off the call to nm_manager_get_device_by_ifindex() until someone actually requests the device. This is not perfect; if someone listening to notify::parent checks right away, they may find that the parent property is still NULL, and notify::parent will not be emitted again when it gets filled in. But it's better than what's there now, when parent would remain NULL forever in this case. NMDeviceVeth did not have this problem, but it did have another possible problem because it wasn't cleaning up its weak references properly.
* core: make nm_manager_get() not ref the managerDan Winship2014-02-262-5/+1
| | | | | | | For consistency with other singleton getters (and to fix the numerous places that are currently calling nm_manager_get() without unreffing it afterward), make nm_manager_get() not ref the manager when returning it.
* po: updated Brazilian Portuguese (pt_BR) translation (bgo #725182)Glaucia Freitas2014-02-261-1635/+2228
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=725182 Signed-off-by: Thomas Haller <thaller@redhat.com>
* merge: really implement DEACTIVATING state and fix re-activation crash (rh ↵Dan Williams2014-02-255-49/+52
|\ | | | | | | | | | | | | | | | | | | | | #1058843) Really implement the DEACTIVATING state this time. This now allows easy "pre-down" hooks whenever we choose to implement that. Next, fix a crash during re-activation where a pending activation request mis-interpreted device state changes from a previous activation request that was deactivating.
| * core: better ignore deactivations before a new activation starts (rh #1058843)Dan Williams2014-02-252-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a new activation request comes in and the device is already activated, two NMActRequests will exist for the device in parallel. The old one handles de-activation of the device and is then disposed, while the new one waits until the device is de-activated and then takes over and starts the new activation. Both requests are watching device state, and the new request may mis-interpret the de-activation states and clean up its device pointer, leading to assertion failures when the new activation starts. To fix this (and because NMVPNConnection *does* always want to see de-activation events from the device) remove the code that tries to ignore de-activation from NMActiveConnection's device state handler. Instead, have NMActRequest skip any reaction to device state changes unless it is the current activation request on the device. The VPN code always wants to see the device's state, so it doesn't need this check.
| * core: queue re-activations to allow DEACTIVATING stateDan Williams2014-02-253-30/+43
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a device is already activated, queue the new activation to allow the transition through the DEACTIVATING state. --- Also remove the "HACK" bits in nm_device_deactivate(). This hack was added on 2007-09-25 in commit 9c2848d. At the time, with user settings services, if a client created a connection and requested that NM activate it, NM may not have read the connection from the client over D-Bus yet. So NM created a "deferred" activation request which waited until the connection was read from the client, and then began activation. The Policy watched for device state changes and other events (like it does now) and activated a new device if the old one was no longer valid. It specifically checked for deferred activations and then did nothing. However, when the client's connection was read, then nm-device.c cleared the deferred activation bit, leading to a short period of time where the device was in DISCONNECTED state but there was no deferred activation, because the device only changes state to PREPARE from the idle handler for stage1. If other events happened during this time, the policy would tear down the device that was about to be activated. This early state transition to PREPARE worked around that. We need to remove it now though, because (a) the reason for its existence is no longer valid, and (b) _device_activate() may now be called from inside nm_device_state_changed() and thus it cannot change to a new state inside the function.
* firewall: ignore UNKNOWN_INTERFACE errorsDan Williams2014-02-251-2/+5
| | | | | | | If the firewall didn't know about the interface, don't log errors about it because there's nothing NM can do. Also, sometimes NM sends the not-IP interface, like when disconnecting WWAN when the PPP interface is already gone.
* libnm-util: fix adding values to 'phase2-altsubject-matches'Jiří Klimeš2014-02-251-5/+6
| | | | It was mixed up with 'altsubject-matches'.
* platform: downgrade error logging about NLE_DUMP_INTR on event socketThomas Haller2014-02-251-3/+13
| | | | | | | | | Such a failure can happen easily, because we now request an initial dump to get AF_INET6 addresses in order to check for extended ifa flags support. This is not critical, so downgrade the error log. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: fix verify_identity() in '802-1x' settingJiří Klimeš2014-02-251-0/+2
| | | | | We need to return FALSE on error, otherwise we pile GErrors and assert in nm_setting_verify().
* settings: free memory in finalize(), not in dispose() in NMSecretAgent (rh ↵Jiří Klimeš2014-02-251-12/+16
| | | | | | | | | #1061911) Even if the code changed in master compared to the bug report, the issues would still occur when we freed members in dispose. https://bugzilla.redhat.com/show_bug.cgi?id=1061911
* trivial: rename function in platformThomas Haller2014-02-241-3/+3
| | | | | | | To make the name analog to init_ip4_address, etc. which start with init_*. Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: share the static buffer for platform to_string functionsThomas Haller2014-02-241-12/+10
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: fix whitespaceThomas Haller2014-02-241-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* replace snprintf by g_snprintfThomas Haller2014-02-247-10/+9
| | | | | | Use the glib wrapper for snprintf. Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: align debugging output in platform signalsThomas Haller2014-02-241-9/+9
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* rdisc: print gateway for routes in rdisc debugging outputThomas Haller2014-02-241-31/+36
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* rdisc: fix invalid cast when printing addresses in config_changed()Thomas Haller2014-02-241-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* docs: use %TRUE, %FALSE macros instead of plain TRUE, FALSE values for gtkdocJiří Klimeš2014-02-248-40/+40
|
* cli: allow resetting the connection.master to NULLThomas Haller2014-02-241-2/+6
| | | | | | | | Without this patch, the following two commands fail: nmcli connection modify em1 connection.master nmcli connection modify em1 connection.master "" Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: minor fix to ensure we call platform functions with positive ifindexThomas Haller2014-02-231-2/+2
| | | | | | | Actually, get_ip_ifindex() should always return 0 or > 0. Just in case, be extra careful and modify the conditions. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: fix waiting for bringing up/taking down deviceThomas Haller2014-02-232-27/+55
| | | | | | | | | | | | | | | | This fixes a regression introduced in 5074898591ae99f79b0cc4872c3c7cf018abee82. The while loop did only refetch the cached value (because the glib main loop was blocked and only the cached device flags were checked). Also, instead on relying of g_usleep(), wait until a maximum time of waiting is expired. The duration of g_usleep() might not be very accurate. Also, do no longer check the cached device state before setting the device flag. The cache might be out of date, so we just set the flag. https://bugzilla.gnome.org/show_bug.cgi?id=724363 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: add nm_platform_link_refresh() function to refresh the libnl cache for ↵Thomas Haller2014-02-233-0/+39
| | | | | | links Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: log warnings if macvlan/gre property reads failDan Winship2014-02-211-0/+8
|
* platform: fix macvlan flags checkingDan Winship2014-02-211-1/+1
| | | | | You can't do an #ifdef on an enum value, so we were actually never requesting IFLA_MACVLAN_FLAGS.
* platform: sanitize a boolean propertyDan Winship2014-02-211-1/+1
| | | | | | | Make sure NMPlatformGreProperties->path_mtu_discovery is always TRUE or FALSE, even if the value from the kernel is "2" or "16" or something. (This makes it consistent with what we do for other boolean netlink properties.)
* merge: various WWAN fixesDan Williams2014-02-217-117/+162
|\
| * mobile: use gateway returned from ModemManagerdcbw/wwan-fuDan Williams2014-02-211-8/+19
| | | | | | | | If we get a gateway, use it.
| * mobile: fix removal of ethernet interfaces owned by modemsDan Williams2014-02-214-11/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the kernel doesn't tag a modem's ethernet interface with DEVTYPE=wwan then NetworkManager has no idea that's a modem (and cannot be used until connected via the control port). Since DEVTYPE=wwan devices get ignored by NM, so should these interfaces when NM knows they are modems. That got broken at some point for ModemManager1, because the data port isn't read until the modem is connected. NM only looked for and removed the data-port-as-ethernet-device when the modem was added, long before the MM1 data port was found. ModemManager does provide a list of ports owned by the modem though, which we can use at modem addition time to remove an ethernet device that is controled by the modem.
| * mobile: only change state to NEED_AUTH during activation (rh #1058308)Dan Williams2014-02-212-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | Auth requests only happen during activation and there's no need to request secrets at any other time. Ensure that the device state won't change to NEED_AUTH except when activating. (There's a case in NMModemBroadband where set_mm_enabled() when the modem is locked may cause this, but we'll solve this a different way later.) https://bugzilla.redhat.com/show_bug.cgi?id=1058308
| * mobile: consolidate secrets requests into NMDeviceModemDan Williams2014-02-214-84/+61
| | | | | | | | | | Both old and new ModemManager classes were doing the same thing, so consolidate that into the superclass and save some LoC.
| * mobile: fix disconnection on deactivationDan Williams2014-02-211-12/+6
|/ | | | | | | | | | | | | | | | When c4fc72c7 began using the DEACTIVATING state, the modem code wasn't updated to handle this. Because it only checked for activating or ACTIVATED states to determine whether the modem was previously connected, and thus when an MM disconnect was needed, when the device enters the DISCONNECTED state it was no longer considered previously active, and not disconnected. Also, remove the NEED_AUTH handling from the modem code's device state switch, because it does not appear to be needed. The modem will only enter NEED_AUTH when it requires PAP/CHAP secrets during the connection attempt or when a PIN is required before enabling the modem. In both cases the modem won't yet be connected, so this code will never be hit.
* libnm-glib: take reference in NMRemoteConnection before calling DBUSThomas Haller2014-02-214-80/+171
| | | | | | | | | | We always have to take a reference to the NMRemoteConnection before calling to DBUS, because the connection might be deleted in the meantime. https://bugzilla.gnome.org/show_bug.cgi?id=723168 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: accept omitting callback in nm_remote_connection_*Thomas Haller2014-02-211-3/+0
| | | | | | | | | The functions nm_remote_connection_save(), nm_remote_connection_commit_changes(), and nm_remote_connection_commit_changes_unsaved() indicate in the documentation, that they allow omitting the callback argument. Remove invalid checks for callback. Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: fix configure.ac commentDan Winship2014-02-191-1/+1
|
* test: add valgrind suppressionsThomas Haller2014-02-181-0/+20
| | | | | | `make check` failed on fc20.armv7hl Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: refactor address_to_string() to return device as numeric if ifname ↵Thomas Haller2014-02-181-24/+33
| | | | | | is unknown Signed-off-by: Thomas Haller <thaller@redhat.com>
* tui: don't expand editor form to fullscreen horizontallyDan Winship2014-02-172-1/+45
| | | | | The form doesn't make use of the extra horizontal space, so it looks bad to expand it rather than centering it.
* tui: fix flickering with large windowsDan Winship2014-02-171-1/+1
| | | | | | | Use newtPopWindowNoRefresh() rather than newtPopWindow() when destroying a form, since often we have to destroy and then almost immediately after re-create the same form, and we don't want that to be visible.
* tui: handle Esc correctly from toplevel windowsDan Winship2014-02-174-7/+37
| | | | | | | | The main "connect" and "edit" windows set the "escape-exits" flag, but that just closed the form without exiting the app, leaving the user trapped. Fix this by emitting a signal when the form quits, and catching that. (And now we don't need to watch the "clicked" signal on the quit buttons, since they have the "exit-on-activate" flag set.)
* tui: handle Wi-Fi networks with multiple APs correctlyDan Winship2014-02-171-0/+62
|
* Fix NMManager:startup tracking again (rh #1030583)Dan Winship2014-02-171-45/+35
|\
| * core: don't recursively schedule an autoactivate check on a deviceDan Winship2014-02-171-31/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMPolicy's auto_activate_device() was immediately removing the device from priv->pending_activation_checks, which meant that if nm_manager_activate_connection() had some side effect that would cause schedule_activation_check() to be called again, another auto-activation check could be queued while the first was still in progress (causing a warning). Fix this by not removing the device from the list until the activation attempt is complete. This requires some additional minor changes to correctly handle the possibility of remove_device() being triggered as a side effect of nm_manager_activate_connection(). Also merge activate_data_new() into schedule_activation_check() so that all the "start an auto-activation" code is in one place.
| * Revert "core: fix warning about pending action "autoactivate""Dan Winship2014-02-171-5/+4
| | | | | | | | | | | | | | | | | | This change removed the "autoactivate" pending action too soon, creating a window where the device had no pending actions, allowing the manager to declare startup complete while devices were still being activated. This reverts commit a16b7a82538e59af19557e03ae54e2e6afb5a891.
| * core: remove some unused codeDan Winship2014-02-171-13/+10
|/ | | | | We never pass any delay_seconds value to schedule_activate_check() except "0", so just remove that argument.
* manager: fix notification of the connectivity propertyGiovanni Campagna2014-02-171-0/+2
| | | | | | | Notify DBus clients at the end of a connectivity check, and when NMConnectivity reports a change. https://bugzilla.gnome.org/show_bug.cgi?id=724550
* cli: better checking of WEP key types in nmcli interactive editor (rh #1040964)Jiří Klimeš2014-02-171-11/+54
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1040964
* core: report which option is unknownGuido Günther2014-02-151-2/+4
| | | | | | | | | | | | | | | So far NetworkManager didn't tell which option it didn't know about: Invalid option. Please use --help to see a list of valid options. Now it is a bit more informative: Unknown option --asdf. Please use --help to see a list of valid options. The "Unknown option" string is marked as translatable in glib so i18n doesn't suffer. Signed-off-by: Thomas Haller <thaller@redhat.com>