Commit graph

9585 commits

Author SHA1 Message Date
Dan Williams
454cc0a168 docs: ignore private nm-test-utils.h header 2014-05-13 13:49:50 -05:00
Dan Williams
a544aa374e merge: make Wi-Fi/OLPC Mesh support a plugin and misc cleanups (bgo #728432) 2014-05-13 13:37:21 -05:00
Dan Williams
9e542faec1 olpc-mesh: mesh device is only available when Wi-Fi companion is found
The mesh and Wi-Fi companion share radio hardware and firmware resources
and you need both to exist for the mesh to function properly and to
ensure that the Wi-Fi and mesh sides cooperate correctly for scanning
and activation.
2014-05-13 12:38:44 -05:00
Dan Williams
7be2627b69 wifi: remove supplicant pending action if supplicant init fails
If the supplicant interface object never successfully initialized, remove
the pending action to prevent warnings about "pending action already added"
when supplicant_interface_acquire() adds the pending action again.
2014-05-13 12:38:44 -05:00
Dan Williams
085bc0876c platform: better detection of OLPC Mesh interfaces
Instead of just looking at the udev tags, also look for sysfs entries
that the libertas driver uses when mesh is enabled.
2014-05-13 12:38:44 -05:00
Dan Williams
8ab45e3e5c olpc-mesh: reorganize functions (trivial)
Move GObject related stuff to the bottom and get rid of forward
declarations that are no longer.

No code changes, only code movement.
2014-05-13 12:38:44 -05:00
Dan Williams
98bd65c6e9 olpc-mesh: rework companion detection
Just listen to manager signals all the time, but only respond to
them when necessary.  Clean up companion detection to be a bit
clearer, and use nm_device_queue_state() so that we don't need
an idle handler when detecting the companion from a state change
handler.
2014-05-13 12:38:44 -05:00
Dan Williams
b486c63034 olpc-mesh: clean up dispose()
Allow it to be called multiple times.
2014-05-13 12:38:43 -05:00
Dan Williams
ee6febf297 olpc-mesh: use g_signal_handlers_disconnect_by_data() 2014-05-13 12:38:43 -05:00
Dan Williams
a9fa1bd9e2 platform: don't crash on link_change() error when ifname is NULL
to_string_link() logs link details and creates a new link to do this,
filling in the various filed in init_link().  init_link() attempts to
fill in the driver name, and might call ethtool to do that.  Well,
ethtool API only accepts an interface name (which we don't have) and
not an ifindex (which we do have), and dies.  Ensure that the ethtool
functions bail out instead of crashing if they don't get an interface
name.

Unfortunately, most callers of link_change() don't bother setting
ifindex or ifname on the link that ends up getting passed to
to_string_link(), because libnl doesn't require that when calling
rtnl_link_change().  Modify all callers to at least set the
ifindex so that to_string_link() has something useful to log.

NetworkManager[10651]: <info> (msh0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
NetworkManager[10651]: (platform/nm-linux-platform.c:684):link_extract_type: runtime check failed: (ifname != NULL)
NetworkManager[10651]: <error> [1398107504.807205] [platform/nm-linux-platform.c:1856] link_change(): Netlink error changing link 12:  <UP> mtu 0 (1) driver 'usb8xxx' udi '/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/net/msh0': Message sequence number mismatch

    at platform/nm-linux-platform.c:691
    at platform/nm-linux-platform.c:1850
    at devices/nm-device.c:5523
    NM_DEVICE_STATE_REASON_NOW_MANAGED) at devices/nm-device.c:6662
    at nm-manager.c:2115
2014-05-13 12:38:43 -05:00
Dan Williams
0171315c78 wifi: collapse Supplicant struct and clean up timeouts
There used to be many more members of the Supplicant struct, but now
that there are only three, collapse the struct into the NMDeviceWifiPrivate
struct, renaming them slightly at the same time to shorten the names.

Second, consolidate timeout cleanup since the two remaining timeouts
don't need their own cleanup functions.

Third, start_supplicant_connection_timeout() doesn't need its own
function since g_timeout_add() never returns 0, so we don't need to
check for it.
2014-05-13 12:38:43 -05:00
Dan Williams
9cc1f1b79a wifi: use g_signal_handlers_disconnect_by_* to clean up code a bit 2014-05-13 12:38:43 -05:00
Dan Williams
0e72c9ef4d wifi: simplify supplicant error signal handling
The only reason for the small struct was the idle handler, and the
only reason for the idle handler was to ensure that state was changed
from an idle handler.  We've got nm_device_queue_state() to do that
for us now, so use it.
2014-05-13 12:38:43 -05:00
Dan Williams
864a0dbb58 wifi: use nm_device_get_connection() to simplify some code 2014-05-13 12:38:43 -05:00
Dan Williams
06e3c6d02f wifi: make Wi-Fi support a plugin
Make Wi-Fi support a plugin using the new device factory interface.
Provides a 7% size reduction in the core NM binary.

        Before    After
NM:    1154104  1071992  (-7%)
Wi-Fi:       0   110464

(all results from stripped files)
2014-05-13 12:38:43 -05:00
Dan Williams
b46b28d18f wifi: remove old ipw rfkill polling functionality
Older Intel "ipw" devices (ipw2100, ipw2200, and ipw2915) only gained
kernel rfkill subsystem integration with 2.6.33.  Before then their
custom rfkill functionality had to be polled via sysfs.  Since we now
require at least a 3.x kernel, remove this old code.
2014-05-13 12:06:58 -05:00
Thomas Haller
b5ffcf46f1 doc: update documentation to show all logging domains
Also, mention the deprecated alias HW in man/NetworkManager.conf

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 19:12:28 +02:00
Thomas Haller
3a19de80f7 nmcli/completion: fix logging domain "OLPC" for nmcli bash completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 19:00:00 +02:00
Thomas Haller
8e88b4e2fa core/logging: trivial renaming internal LOGD_OLPC_MESH name to LOGD_OLPC
The domain LOGD_OLPC_MESH is known as "OLPC". This is the only case where
the internal name LOGD_X does not correspond to the external name X.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 18:52:27 +02:00
Thomas Haller
4e8a91e6f8 Revert "contrib: fix "Illegal sequence '..' in Fedora specfile Release"
This reverts commit 8f44bf047f.

This spec file is not intended to be passed directly to rpmbuild,
because it contains placeholders that are substituted by the build.sh
script.

As such, the version we want to get is
  NetworkManager-0.9.9.1-7922.66eb52b53d.fc20.src.rpm
instead of
  NetworkManager-0.9.9.1-792266eb52b53d.fc20.src.rpm

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 13:00:27 +02:00
Jiří Klimeš
810e934892 libnm-util: add nm_utils_rsa_key_encrypt_aes() encrypting RSA key with AES 2014-05-12 10:46:41 +02:00
Jiří Klimeš
b3e39d4275 libnm-util: allow AES cipher for private keys
and add a testcase to check the encryption with AES.
2014-05-12 10:46:41 +02:00
Jiří Klimeš
a9f5494d4d libnm-util: do not call crypto_md5_hash() for empty passwords
It happens when one selected private key, but didn't provide the password yet
in nm-connection-editor.

(nm-connection-editor:11080): libnm-util-CRITICAL **: crypto_md5_hash: assertion `password_len > 0' failed
2014-05-12 10:46:41 +02:00
Jiří Klimeš
31cd3fe444 libnm-util: return better error messages on failures for _set_ functions 2014-05-12 10:46:41 +02:00
Dan Williams
66eb52b53d merge: remove mostly-unused hostname provider functionality (bgo #727609) 2014-05-09 15:33:42 -05:00
Dan Williams
b732240026 core: remove the HostnameProvider interface
It's only used to keep the DHCPManager up-to-date with hostname changes,
and that can be accomplished in much less code by just having NMManager
set a hostname on the DHCPManager itself.
2014-05-09 15:33:32 -05:00
Dan Williams
d336a78a0e core: don't ref/unref the DHCP manager
It's a singleton anyway, so no need to ref/unref it.  Just use it.
2014-05-09 15:33:32 -05:00
Dan Williams
11f9855223 core: emit dhcp4/dhcp6-change dispatcher events if other IP completes first (rh #1091296) (bgo #729284)
If IPv6 completes first it would emit the "up" dispatcher event with IPv6
details and move the device to ACTIVATED state.  But if DHCPv4 was still
running, no dispatcher event would be emitted with the DHCPv4 information
until the first lease renew.  Thus dispatcher scripts would not receive
DHCPv4 information for quite some time.

Ensure that if the other IP version completes first, that when the slower
method's DHCP completes, that it emits the appropriate dhcp4-change
or dhcp6-change event so that dispatcher scripts get the information
as soon as it's available.

https://bugzilla.gnome.org/show_bug.cgi?id=729284
2014-05-09 15:25:27 -05:00
poma
8f44bf047f contrib: fix "Illegal sequence '..' in Fedora specfile Release
$ rpmbuild -bp NetworkManager.spec
error: line 47: Illegal sequence ".." in: Release: 10.git20140508..429023b.fc21

Signed-off-by: poma <pomidorabelisima@gmail.com>
2014-05-09 11:56:30 -05:00
Aleksander Morgado
2b82fd0e1d ppp: avoid pppd exiting when no traffic going through
By default pppd will suicide if there are 600s without traffic going through:

  pppd[30575]: Terminating connection due to lack of activity.
  pppd[30575]: Connect time 10.0 minutes.
  pppd[30575]: Sent 0 bytes, received 0 bytes.

This is likely to happen when e.g. the system has both a mobile broadband
connection and an ethernet connection, as the ethernet will take the default
route.

So, avoid this behaviour by explicitly telling pppd not to exit if idle.
2014-05-09 11:54:46 -05:00
Jiří Klimeš
050c30da0b keyfile: don't put VPN 'user-name' property to vpn.data on read (rh #1060460)
https://bugzilla.redhat.com/show_bug.cgi?id=1060460
2014-05-09 14:22:13 +02:00
Dan Williams
429023b24e policy: remove old /etc/hosts cleaning code (bgo #729689)
NetworkManager stopped touching /etc/hosts in late 2010 before the
NetworkManager 0.8.1 release.  The code in nm-policy-hosts.c's only
purpose is to remove any of the entries that NetworkManager added long
ago.

I think we're at the point where people have already upgraded to
NetworkManager 0.8.1 or later and thus this code would be a NOP.  The
only risk is that some stale /etc/hosts entries will be left if you
upgrade from NM 0.8 or lower to anything higher than that.

FWIW, Ubuntu Lucid (10.04) ships NM 0.8.0 and SLES11 ships NM 0.7.0, so
if users of these distros upgraded to a later NetworkManager they might
run into the stale entries issue if we remove this code from NM.  But
given how old these distros are, it seems unlikely that users will do a
direct upgrade to something 4+ years newer...

https://bugzilla.gnome.org/show_bug.cgi?id=729689
2014-05-08 15:09:59 -05:00
Thomas Haller
dd3d5b2220 contrib/rpm: merge branch 'automation' (add scripts to build RPM from master)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:17:58 +02:00
Thomas Haller
fb8a5f7ac9 contrib/rpm: update spec file to explicitly --disable-gtk-doc
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:37 +02:00
Thomas Haller
b322642a03 contrib/rpm: add script build_clean.sh to create clean RPM files 2014-05-07 18:16:36 +02:00
Thomas Haller
886366d0fd contrib/rpm: update spec file after renaming NM plugins
Rename NetworkManager-atm to NetworkManager-adsl
and NetworkManager-bt to NetworkManager-bluetooth.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:36 +02:00
Thomas Haller
f9229a33c7 contrib/rpm: modify spec file to create packages for NM plugins
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:36 +02:00
Thomas Haller
b057d5179e contrib/rpm: build.sh uses the number of git commits as RELEASE_VERSION
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-07 18:16:36 +02:00
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