Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
a9ed313956 contrib/rpm: fix release version in rpm change log
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:36 +02:00
Thomas Haller
6db1d68e3f contrib/rpm: update NetworkManager.spec
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:13 +02:00
Thomas Haller
8b6966bfe7 contrib/rpm: fix spec file for fc20
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 17:14:36 +02:00
Thomas Haller
8871aad554 contrib/rpm: update spec file to build nmtui from in-tree source
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 17:14:36 +02:00
Thomas Haller
cc45fe0a7e contrib/rpm: add spec file and script to build a RPM package
This one spec file is intended to build packages for F18, F19, F20, and
rhel-7.0.

The build script can be tweaked by setting environment variables, but it
is supposed to choose the right default values on it's own.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 17:14:36 +02:00
Thomas Haller
f1440bff12 build: fix out-of-tree build for rdisc/tests
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 15:02:17 +02:00
Thomas Haller
815245320d libnm-util: fix crash in NMSettingInfiniband when setting key or parent property
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 09:13:33 +02:00
Dan Williams
80a4b15252 merge: support WWAN autoconnect, multiple modems with rfkill, low-power mode (bgo #728044)
https://bugzilla.gnome.org/show_bug.cgi?id=728044
2014-05-06 21:54:44 -05:00
Dan Williams
837bf2e33a wwan: set modem to low power state when disabling
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).
2014-05-06 21:51:25 -05:00
Dan Williams
e7987b9185 wwan: read device & SIM identifiers from ModemManager
We'll use these later for device/SIM specific operations.
2014-05-06 21:51:25 -05:00
Dan Williams
d043094195 wwan: disable autoconnect if the given SIM PIN was wrong
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)
2014-05-06 21:51:24 -05:00
Dan Williams
6080425088 wwan: use modem states instead of enabled/connected properties
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.
2014-05-06 21:48:55 -05:00
Dan Williams
bb1fece6e6 wwan: make device available whenever it's not rfkilled
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.
2014-05-06 14:15:50 -05:00
Dan Williams
5d8197a80b core: ignore modem management service state in rfkill handling
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.
2014-05-06 14:15:50 -05:00
Dan Williams
876ec0c755 rfkill: toggle WWAN rfkill state on user enable/disable
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.
2014-05-06 14:15:50 -05:00
Jiří Klimeš
b764766517 trivial: fix typo BBSID -> BSSID 2014-05-06 16:55:50 +02:00
Thomas Haller
7b65c80712 core: minor cleanup to release GValue for G_TYPE_OBJECT
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-05 20:59:51 +02:00
Thomas Haller
c30fd99f6f platform: merge branch 'th/bgo726275_div_refact_platform'
https://bugzilla.gnome.org/show_bug.cgi?id=726275

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 03:45:10 +02:00
Thomas Haller
d16761d939 platform/trivial: rename object type enums to give them a common name prefix
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 03:44:23 +02:00
Thomas Haller
59a56a0aff platform: add function nm_platform_link_cmp()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 03:44:23 +02:00
Thomas Haller
78b8af6651 core: preserve later expiry in nm_ip[46]_config_add_address()
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>
2014-05-03 03:44:23 +02:00
Thomas Haller
9cd7b40a04 platform: add nm_platform_ip_address_cmp_expiry()
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>
2014-05-03 03:44:23 +02:00
Thomas Haller
a8c17a2517 platform: extract common fields of IPv4/IPv6 addresses and routes to base struct
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>
2014-05-03 03:44:22 +02:00
Thomas Haller
09d3c833fd platform: refactor signals by combining added/changed/removed
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>
2014-05-03 03:44:22 +02:00
Thomas Haller
38ffd3eb9b platform: refactor build_rtnl_addr() by replacing addr4_to_broadcast()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 03:44:22 +02:00
Thomas Haller
857e5e0b21 platform: don't zero terminate the result GArray of get_all() functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 03:44:22 +02:00
Thomas Haller
53b6a99798 platform: refactor ip4_route_get_all() and ip6_route_get_all()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 01:03:06 +02:00
Thomas Haller
a4d2d71409 platform: refactor ip4_address_get_all() and ip6_address_get_all()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-03 01:03:06 +02:00
Thomas Haller
9ef23947cc all: fix various warnings detected with coverity
https://bugzilla.gnome.org/show_bug.cgi?id=728320

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-02 15:20:30 +02:00
Thomas Haller
981e33b83b core: replace readlink() by glib equivalent in NMDeviceEthernet
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>
2014-05-02 14:21:53 +02:00
Thomas Haller
4a22cefc6c core: add configuration main.debug and interpret environment variable NM_DEBUG
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>
2014-05-02 11:08:14 +02:00
Thomas Haller
f5b82f49dd core: merge branch 'th/rh1086906_start_complete_for_dynamic_ip'
https://bugzilla.redhat.com/show_bug.cgi?id=1086906

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-01 22:09:05 +02:00
Thomas Haller
516d66210f core: wait with "startup complete" for both IPv4 and IPv6 dynamic configuration
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>
2014-05-01 22:06:52 +02:00
Thomas Haller
a16faa3985 core: add parameter to ignore error in add/remove pending action
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>
2014-05-01 22:06:52 +02:00
Dan Winship
50bafeaf2e dns-manager: fix the rules for public suffixes and search domains (rh #851521)
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
2014-04-29 14:47:25 -04:00
Dan Winship
93c10a6eea dns-manager: don't write "domain" to resolv.conf
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
2014-04-29 14:47:25 -04:00
Dan Winship
7f5b2f81b0 tui: fix route editing (rh #1090422)
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
2014-04-29 10:36:54 -04:00
Dan Williams
b77b7510d6 examples: update 70-wifi-wired-exclusive.sh (bgo #513488)
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
2014-04-28 17:07:02 -05:00
Peter Wu
a2eb4789ac platform: set link scope for IP4LL addresses
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>
2014-04-27 15:32:07 +02:00
Dan Winship
c0254336ce introspection: fix Device.Ip4Address type
https://bugzilla.gnome.org/show_bug.cgi?id=720963
2014-04-25 12:58:12 -04:00
Dan Winship
0c2586a786 tui: fix title of "Edit Connection" form (rh #1090397)
Form titles should be in titlecase; this was the only one that wasn't.
2014-04-25 11:22:38 -04:00
Dan Winship
a54fa87108 ifcfg-rh: fix alias tests to not depend on directory read order
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.
2014-04-25 11:22:15 -04:00
Thomas Haller
6ba897120c Merge branch 'th/bg728320_coverity'
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>
2014-04-24 21:22:29 +02:00
Thomas Haller
cf96ced717 ifcfg-rh: fix leak in svOpenFileInternal()
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:44 +02:00
Thomas Haller
628e774ba8 ifcfg-rh: fix crash for reading invalid bridge configuration
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:44 +02:00
Thomas Haller
73d4edb0b7 core: fix leaks for nm_setting_ip[46]_config_add_\(route\|address\)()
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:08 +02:00
Thomas Haller
f19e79cd7a core: fix potential crash in nm-dhcp-client
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:08 +02:00
Thomas Haller
9305c5bbf7 man/cli: add missing log domains to manual page and nmcli bash completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 17:27:47 +02:00
Jiří Klimeš
f69842aa57 tui: fix a crash when connecting to a password-secured Wi-Fi (rh #1090773)
'dialog' and 'co' were swapped in maybe_save_input_and_exit().

https://bugzilla.redhat.com/show_bug.cgi?id=1090773
2014-04-24 13:56:47 +02:00
Thomas Haller
785c2a8c95 all/test: modify makefiles to run tests (without arguments) via autoconf TESTS=
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>
2014-04-23 21:28:55 +02:00