summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wwan: set modem to low power state when disablingdcbw/wwan-fixesDan Williams2014-05-061-1/+27
| | | | | | | When WWAN airplane mode is enabled, set modems to low power state to ensure they are in airplane mode if either (a) the machine does not have an rfkill switch, or (b) the modem is not tied to any rfkill switch (eg, external USB/SDIO/etc).
* wwan: read device & SIM identifiers from ModemManagerDan Williams2014-05-064-4/+127
| | | | We'll use these later for device/SIM specific operations.
* wwan: disable autoconnect if the given SIM PIN was wrongDan Williams2014-05-068-2/+61
| | | | | | | | | | If the given PIN was wrong, we really don't want to try that PIN again automatically because it might lock the SIM. To ensure that doesn't happen, disable autoconnect so that the user must manually request reconnection. (this doesn't fix auto-connect-with-a-wrong-PIN completely, as autoconnect is reset when resuming from sleep, but it's a start)
* wwan: use modem states instead of enabled/connected propertiesDan Williams2014-05-069-224/+391
| | | | | | | | | | | | | | | | | | | | | | | | Determining when the NMDeviceModem is available and when different connections are available is easier if the modem's state is tracked, instead of using the separate Enabled and Connected properties. These properties could not accurately represent the SIM lock state and prevented NetworkManager from making the modem available for auto-activation when locked, even if a PIN was available. In this new scheme, the NMDeviceModem is UNAVAILABLE when the ModemManager modem state is FAILED, UNKNOWN, or INITIALIZING. It transitions to the NM DISCONNECTED state when the modem has finished initializing and has not failed. Once the NMDeviceModem is in DISCONNECTED state it can be activated even if the SIM is locked and a PIN is required; the PIN will be requested when starting activation, either from the connection itself or via a secrets request. This makes auto-activation of WWAN connections possible. This also allows us to consolidate code dealing with modem enable/disable into the base NMModem class using the modem state, and to log more modem information for debugging purposes.
* wwan: make device available whenever it's not rfkilledDan Williams2014-05-061-15/+48
| | | | | | | | | | | | | Since the ModemManager enabled/disabled state is a user-changable one, and since NM can enable the modem when starting a connection, allow modems to be available for activation whenever they are not in airplane mode. This makes WWAN autoconnect=true connections actually autoconnect. If the first connection fails during ModemManager setup for fatal reasons (missing SIM, bad PIN, not registered), autoconnect will be blocked for that connection until activation is manually requested and succeeds.
* core: ignore modem management service state in rfkill handlingDan Williams2014-05-063-85/+6
| | | | | | | | | | | | rfkill handling should only pay attention to actual rfkill, since rfkill is global but the modem management service state is per-device. Thus calculating a global state from multiple devices is very likely to get things wrong. Remove all of the code that used to handle that sort of thing, which means removing the 'enable-changed' signal from the Modem device, since now nothing external to the modem device should need to care whether it's enabled internally or not.
* rfkill: toggle WWAN rfkill state on user enable/disableDan Williams2014-05-061-13/+30
| | | | | | | Poke the kernel's WWAN rfkill state when the user changes our WWANEnabled property, the same as we do for WiFi. Also restore saved WWAN state on startup, as we do for WiFi. No good reason why WWAN should be different here.
* trivial: fix typo BBSID -> BSSIDJiří Klimeš2014-05-061-2/+2
|
* core: minor cleanup to release GValue for G_TYPE_OBJECTThomas Haller2014-05-051-1/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: merge branch 'th/bgo726275_div_refact_platform'Thomas Haller2014-05-0315-503/+514
|\ | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=726275 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform/trivial: rename object type enums to give them a common name prefixThomas Haller2014-05-031-61/+61
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: add function nm_platform_link_cmp()Thomas Haller2014-05-033-0/+27
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: preserve later expiry in nm_ip[46]_config_add_address()Thomas Haller2014-05-032-8/+43
| | | | | | | | | | | | | | | | | | When adding the same addresses from different sources, we want to preserve the times with the later expiry . If the new address comes from the kernel itself, we treat it specially and prefer the times from other sources. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: add nm_platform_ip_address_cmp_expiry()Thomas Haller2014-05-032-1/+53
| | | | | | | | | | | | | | This compares two addresses and returns which one has a longer remaining life (i.e. a later expiry timestamp). Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: extract common fields of IPv4/IPv6 addresses and routes to base structThomas Haller2014-05-031-23/+66
| | | | | | | | | | | | | | | | | | Especially the calculation of timestamps is identicall for addresses. By creating a "base struct", we can use the same code for that, because NMPlatformIP4Address and NMPlatformIP6Address can now both be treated as NMPlatformIPAddress (and the same for routes). Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: refactor signals by combining added/changed/removedThomas Haller2014-05-0313-339/+249
| | | | | | | | | | | | | | | | Before platform raised 3 signals for each object type. Combine them into one and add a new parameter @change_type to distinguish between the change type. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: refactor build_rtnl_addr() by replacing addr4_to_broadcast()Thomas Haller2014-05-031-21/+2
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: don't zero terminate the result GArray of get_all() functionsThomas Haller2014-05-032-7/+7
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: refactor ip4_route_get_all() and ip6_route_get_all()Thomas Haller2014-05-031-38/+18
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: refactor ip4_address_get_all() and ip6_address_get_all()Thomas Haller2014-05-031-26/+9
|/ | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: fix various warnings detected with coverityThomas Haller2014-05-0210-30/+13
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: replace readlink() by glib equivalent in NMDeviceEthernetThomas Haller2014-05-021-9/+6
| | | | | | | | | | | | Makes the function working for link destinations longer then 127 bytes and fixes a potential bug that the result of readlink() was not zero terminated for long paths. Probably this would be no problem, but better be save. Related: https://bugzilla.redhat.com/attachment.cgi?id=885371 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: add configuration main.debug and interpret environment variable NM_DEBUGThomas Haller2014-05-024-0/+62
| | | | | | | | | | | Interpret the configuration option main.debug and the environment variable NM_DEBUG as a comma separated list of debugging options (parsed with g_parse_debug_string()). Currently only the option "RLIMIT_CORE" is supported, to set the core dump size to unlimited. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: merge branch 'th/rh1086906_start_complete_for_dynamic_ip'Thomas Haller2014-05-017-44/+108
|\ | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1086906 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: wait with "startup complete" for both IPv4 and IPv6 dynamic configurationThomas Haller2014-05-012-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of DHCP4, DHCP6 and/or SLAAC, delay "startup complete" until both IPv4 and IPv6 are ready. This especially has an effect on nm-online/NetworkManager-wait-online.service, which blocks until configuration of both IPv4 and IPv6 is ready. We queue a pending_action when automatic configuration starts and remove it again, when we receive an address. Before, "startup complete" was reached when either one of the two IP protocols was configured. https://bugzilla.redhat.com/show_bug.cgi?id=1086906 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: add parameter to ignore error in add/remove pending actionThomas Haller2014-05-016-43/+74
|/ | | | | | | | | | Add a parameter to nm_device_add_pending_action() to silently accept adding duplicate actions. Same for nm_device_remove_pending_action(), to silently ignore removing non-pending actions. Signed-off-by: Thomas Haller <thaller@redhat.com>
* dns-manager: fix the rules for public suffixes and search domains (rh #851521)Dan Winship2014-04-291-10/+15
| | | | | | | | | | | | | | | | | dfe194ee made it so that we don't use "public suffixes" as resolv.conf search domains (eg, we don't add "search com" if the hostname is "example.com"). However, if this results in us writing a resolv.conf with no "search" line at all, then the resolver will fall back to using the parent domain of the hostname as a search domain anyway, thwarting us. To fix that, use the domain itself as a search domain in this case, since that's likely to be the expected behavior anyway. (And even if it's not, there doesn't appear to be any way to block the resolver from using the hostname's parent domain as a search domain unless we specify at least one search domain ourselves.) https://bugzilla.gnome.org/show_bug.cgi?id=729137
* dns-manager: don't write "domain" to resolv.confDan Winship2014-04-291-35/+11
| | | | | | | | | | | | resolv.conf(5) says: The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins. NM always writes out a "search" line if it writes a "domain" line, so the "domain" line is always a no-op. So drop it. https://bugzilla.gnome.org/show_bug.cgi?id=729137
* tui: fix route editing (rh #1090422)Dan Winship2014-04-291-1/+8
| | | | | | | | | NmtRouteTable's ip4-routes and ip6-routes properties have the D-Bus-based route list types (like the corresponding NMSetting properties) so we have to convert our GSList-of-NMIP[46]Route data into those types when updating the property. https://bugzilla.gnome.org/show_bug.cgi?id=728958
* examples: update 70-wifi-wired-exclusive.sh (bgo #513488)Dan Williams2014-04-281-20/+9
| | | | | | | | | | Tighten up with suggestions from Johannes Buchner and mention his contribution. Also fixes operation with current nmcli since it changed from "802-3-ethernet" -> "ethernet" and thus the script was broken. https://bugzilla.gnome.org/show_bug.cgi?id=513488
* platform: set link scope for IP4LL addressesPeter Wu2014-04-271-0/+13
| | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=728595 [thaller@redhat.com: minor change in coding style] Signed-off-by: Thomas Haller <thaller@redhat.com>
* introspection: fix Device.Ip4Address typeDan Winship2014-04-251-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=720963
* tui: fix title of "Edit Connection" form (rh #1090397)Dan Winship2014-04-251-1/+1
| | | | Form titles should be in titlecase; this was the only one that wasn't.
* ifcfg-rh: fix alias tests to not depend on directory read orderDan Winship2014-04-254-27/+54
| | | | | | | test_read_wired_aliases_bad() would succeed or fail depending on the order that ifcfg-aliasem1:1 and ifcfg-aliasem1:2 got read from disk. Fix this by splitting it into two separate tests, each with only a single alias.
* Merge branch 'th/bg728320_coverity'Thomas Haller2014-04-245-10/+14
|\ | | | | | | | | | | | | | | Fix bugs (memory leaks and potential crashes), found using coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * ifcfg-rh: fix leak in svOpenFileInternal()Thomas Haller2014-04-241-0/+1
| | | | | | | | | | | | | | | | Error found by coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * ifcfg-rh: fix crash for reading invalid bridge configurationThomas Haller2014-04-241-8/+7
| | | | | | | | | | | | | | | | Error found by coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: fix leaks for nm_setting_ip[46]_config_add_\(route\|address\)()Thomas Haller2014-04-242-1/+5
| | | | | | | | | | | | | | | | Error found by coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: fix potential crash in nm-dhcp-clientThomas Haller2014-04-241-1/+1
|/ | | | | | | | Error found by coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
* man/cli: add missing log domains to manual page and nmcli bash completionThomas Haller2014-04-243-3/+4
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* tui: fix a crash when connecting to a password-secured Wi-Fi (rh #1090773)Jiří Klimeš2014-04-241-2/+2
| | | | | | 'dialog' and 'co' were swapped in maybe_save_input_and_exit(). https://bugzilla.redhat.com/show_bug.cgi?id=1090773
* all/test: modify makefiles to run tests (without arguments) via autoconf TESTS=Thomas Haller2014-04-2310-32/+12
| | | | | | | This results in some nice coloring. Only move the tests that are called without arguments from check-local to TESTS. Signed-off-by: Thomas Haller <thaller@redhat.com>
* ifnet/test: fix test breakage after refactoring testsThomas Haller2014-04-231-3/+0
| | | | | | | | Remove fake platform. This regression was introduced by commit 0140cdb73d8f0724632677658a8dac24ebd590e4). Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: clean up "make check" results (bgo #727764)Dan Winship2014-04-2359-675/+1050
|\
| * core: use g_test_expect_message() in test programsDan Winship2014-04-237-54/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use g_test_expect_message() in the various daemon-side test programs, to avoid spewing error messages when (successfully) running "make check". The ifnet and ifupdown plugins are extremely verbose, so they were partially "fixed" by turning down the logging level from INFO to WARN in those tests. test-dhcp-options needed to be converted to gtestutils so that the newly-added check in nm-dbus-manager would recognize it as a test program and not try to create a private bus.
| * dbus-manager: don't try to create private bus in test programsDan Winship2014-04-231-4/+16
| | | | | | | | | | | | When running test programs, don't try to create a private bus, since it will fail if the user isn't root or if NetworkManager is currently running, and it isn't what we want anyway.
| * settings: use nm_log_info/warning() in settings pluginsDan Winship2014-04-2326-609/+492
| | | | | | | | | | | | | | | | Remove the PLUGIN_PRINT() and PLUGIN_WARN() macros and use the standard NM logging functions instead. Also changed PLUGIN_PRINT("error: ...") to nm_log_warn("...") in places.
| * logging: use GLib's logging functions if not using syslogDan Winship2014-04-231-8/+14
| | | | | | | | | | | | If nm_logging_syslog_openlog() isn't called (ie, in the test programs), then route nm_log() messages to g_log() rather than just using fprintf().
| * libnm-util: use g_test_expect_message() in testsDan Winship2014-04-232-0/+131
| | | | | | | | | | Use g_test_expect_message(), to avoid spewing tons of error messages when (successfully) running "make check".
| * all: set G_LOG_DOMAIN appropriately, for better g_log() messagesDan Winship2014-04-2331-0/+34
|/