8 years agoip6: improved logging of address and route changes
Pavel Šimerda [Tue, 22 May 2012 11:50:36 +0000]
ip6: improved logging of address and route changes

Introduce logging of individual address and route changes. Rename
process_addr() and process_route() to process_address_change() and
process_route_change() so that it is clear that we react to both
addition and deletion.

8 years agoip6: log ip configuration state changes
Pavel Šimerda [Thu, 17 May 2012 15:10:46 +0000]
ip6: log ip configuration state changes

Every state change should go through device_set_state(). This
static function provides state change logging. Function
state_to_string is moved up so that we can use it.

8 years agoip6: split nm_ip6_device_sync_from_netlink
Pavel Šimerda [Wed, 9 May 2012 15:12:15 +0000]
ip6: split nm_ip6_device_sync_from_netlink

Split nm_ip6_device_sync_from_netlink into multiple functions.
It will now call the smaller functions and may disappear entirely
in the future.

To share state between these (and possible future) functions,
move local variables found_linklocal, found_other and dhcp_opts
to NMIP6Device as has_linklocal and has_nonlinklocal and dhcp_opts.

8 years agoip6: removed process_prefix() and config_changed variable
Pavel Šimerda [Tue, 22 May 2012 09:49:56 +0000]
ip6: removed process_prefix() and config_changed variable

The kernel appears to always add a default route pointing to the router
that sent the RA, regardless of the contents of the RA:

ndisc_router_discovery() calls rt6_add_dflt_router() which calls
ip6_route_add() which calls __ip6_ins_rt() which calls fib6_add() which
calls fib6_add_rt2node(), which calls inet6_rt_notify(RTM_NEWROUTE, rt,

So skip listening for RTM_NEWPREFIX and just rely on NEWROUTE instead.

The config_changed lost its meaning because RTM_NEWPREFIX was the only
case where it was FALSE.

8 years agocli: list 'autoconnect' property in 'nmcli dev list'
Jiří Klimeš [Wed, 23 May 2012 11:25:43 +0000]
cli: list 'autoconnect' property in 'nmcli dev list'

8 years agocore: initialize 'autoconnect' member variable in nm_device_init()
Jiří Klimeš [Wed, 23 May 2012 11:07:58 +0000]
core: initialize 'autoconnect' member variable in nm_device_init()

8 years agodbus: remove 'max_replies_per_connection' limit from D-Bus configuration
Jiří Klimeš [Wed, 23 May 2012 08:31:12 +0000]
dbus: remove 'max_replies_per_connection' limit from D-Bus configuration

It is leftover from times when D-Bus default limit was 32. Now, it is 8192, see
See also

8 years agolibnm-glib: add 'autoconnect' property for devices
Jiří Klimeš [Mon, 14 May 2012 15:09:36 +0000]
libnm-glib: add 'autoconnect' property for devices

8 years agocore: authenticate Set() D-Bus call for NMDevice "Autoconnect" property
Jiří Klimeš [Thu, 17 May 2012 15:01:10 +0000]
core: authenticate Set() D-Bus call for NMDevice "Autoconnect" property

8 years agocore: add "Autoconnect" property to NMDevice
Jiří Klimeš [Mon, 14 May 2012 13:32:54 +0000]
core: add "Autoconnect" property to NMDevice

It is bound to autoconnect_inhibit private variable (has opposite meaning).
While 'Autoconnect' is TRUE (default value) the device can automatically
activate a connection. If it is changed to FALSE, the device will not
auto-activate until 'Autoconnect' is TRUE again.
Disconnect() method sets 'Autoconnect' to FALSE. NMPolicy monitors the property
and schedules auto activation when FALSE->TRUE transition is made.

8 years agocli: fill active connections' data even if we can't get NMConnection
Jiří Klimeš [Tue, 22 May 2012 14:54:44 +0000]
cli: fill active connections' data even if we can't get NMConnection

This can happen e.g. when D-Bus limits number of replies and there's
a lot of connections. Then nm_remote_settings_list_connections() won't
return all connections and the connection that was activated can be among
the missing connections.

8 years agocore: unblock signals for child processes we spawn out of NM (rh #739836)
Jiří Klimeš [Mon, 21 May 2012 12:10:05 +0000]
core: unblock signals for child processes we spawn out of NM (rh #739836)

Commit 217c5bf6ac2284261e5c868d393d4b7d02ca5569 fixed processing of unix
signals: signals are blocked in all threads and a dedicated thread handles the
signals using sigwait().
However, the commit forgot that child processes inherit signal mask as well.
That is why we have to unblock signals for child processes we spawn from NM, so
that they can receive signals.

8 years agorelease: update NEWS with ADSL support
Dan Williams [Fri, 18 May 2012 21:26:10 +0000]
release: update NEWS with ADSL support

8 years agotodo: remove ADSL item
Dan Williams [Thu, 17 May 2012 22:16:27 +0000]
todo: remove ADSL item

8 years agocore: clarify device routing priority
Dan Williams [Thu, 17 May 2012 22:01:50 +0000]
core: clarify device routing priority

Instead of using the device's type number, which is a poor measure of
routing priority since it has nothing to do with routing priority,
let's make the decision more explicit.

8 years agoadsl: talk ADSL ioctls directly and kill usage of br2684ctl
Dan Williams [Fri, 9 Dec 2011 05:43:41 +0000]
adsl: talk ADSL ioctls directly and kill usage of br2684ctl

The code to set up ATM interfaces is actually pretty simple,
so don't bother spawning br2684ctl at all.  Just do the
necessary communication with the kernel directly and save
a bunch of code.

Note: this isn't very likely to work as I don't have an
ADSL connection to test with.  Testing help appreciated.

8 years agoadsl: fix up for IP config flow changes
Dan Williams [Thu, 8 Dec 2011 20:22:58 +0000]
adsl: fix up for IP config flow changes

8 years agoadsl: cleanups and some rearranging
Dan Williams [Thu, 8 Dec 2011 19:52:08 +0000]
adsl: cleanups and some rearranging

8 years agoadsl: initial PPPoE support for ADSL devices
Pantelis Koukousoulas [Thu, 26 May 2011 18:04:59 +0000]
adsl: initial PPPoE support for ADSL devices

8 years agoadsl: add libnm-glib and nmcli code
Pantelis Koukousoulas [Tue, 17 May 2011 18:03:20 +0000]
adsl: add libnm-glib and nmcli code

For the finale, this is the libnm-glib and nmcli part of the support,
with this you can now make a full pppoatm connection from NetworkManager
by configuring it in system scope in a keyfile.

As an example, here is mine:
(password and username snipped for obvious reasons)





Extract from logs:
NetworkManager[29155]: <info> Activation (ueagle-atm0) starting connection 'MYISP'
NetworkManager[29155]: <info> (ueagle-atm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) starting...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) successful.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) scheduled.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) started...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: config -> ip-config (reason 'none') [50 70 0]
NetworkManager[29155]: <info> starting PPP connection
NetworkManager[29155]: <debug> [1304671146.590156] [nm-ppp-manager.c:1047] nm_ppp_manager_start(): command line: /usr/sbin/pppd nodetach lock nodefaultroute user plugin 8.35 noipdefault noauth usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/0 plugin /opt/nmadsl/lib/pppd/2.4.5/
NetworkManager[29155]: <info> pppd started with pid 29175
NetworkManager[29155]: <debug> [1304671146.591235] [NetworkManagerUtils.c:816] nm_utils_get_proc_sys_net_value(): (ueagle-atm0): error reading /proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra: (4) Failed to open file '/proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra': No such file or directory
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) complete.
Plugin loaded.
Plugin /opt/nmadsl/lib/pppd/2.4.5/ loaded.
** Message: nm-ppp-plugin: (plugin_init): initializing
** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
NetworkManager[29155]: <debug> [1304671146.612937] [nm-udev-manager.c:621] handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0'
NetworkManager[29155]: <debug> [1304671146.613134] [nm-udev-manager.c:525] net_add(): ignoring interface with type 512
NetworkManager[29155]: <debug> [1304671146.617308] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x1090
Using interface ppp0
Connect: ppp0 <--> 8.35
** Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate'
** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting credentials...
NetworkManager[29155]: <debug> [1304671149.639511] [nm-agent-manager.c:1044] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/0 (adsl)
NetworkManager[29155]: <debug> [1304671149.639684] [nm-settings-connection.c:717] nm_settings_connection_get_secrets(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets requested flags 0x1 hint 'password'
NetworkManager[29155]: <debug> [1304671149.640950] [nm-agent-manager.c:959] get_start(): (0x9b4ad10/adsl) system settings secrets sufficient
NetworkManager[29155]: <debug> [1304671149.641332] [nm-settings-connection.c:573] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) existing secrets returned
NetworkManager[29155]: <debug> [1304671149.641541] [nm-settings-connection.c:579] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets request completed
NetworkManager[29155]: <debug> [1304671149.643074] [nm-settings-connection.c:618] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) new agent secrets processed
** Message: nm-ppp-plugin: (get_credentials): got credentials from NetworkManager
PAP authentication succeeded
** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
local  IP address
remote IP address
primary   DNS address
secondary DNS address
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: <debug> [1304671150.607440] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: <info> PPP manager(IP Config Get) reply received.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) started...
NetworkManager[29155]: <debug> [1304671150.608918] [nm-system.c:222] sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: <info> (ueagle-atm0): device state change: ip-config -> activated (reason 'none') [70 100 0]
NetworkManager[29155]: <info> Policy set 'MYISP' (ppp0) as default for IPv4 routing and DNS.
NetworkManager[29155]: <info> Activation (ueagle-atm0) successful, device activated.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas <>

8 years agoadsl: carrier handling and PPPoA support
Pantelis Koukousoulas [Tue, 17 May 2011 18:03:19 +0000]
adsl: carrier handling and PPPoA support

This is the "juice" of the patch series. Initial cut at carrier handling
(by polling /sys/class/atm/$iface/carrier) and also support for calling
pppd with the proper command-line to achieve a connection.

Also implement the necessary boilerplate for the NM state machine to
be happy with our device.

This is a "duct tape and gum" implementation, i.e., prefer copy&paste
over proper refactoring, due to limited time, but the foundations are
now there, so we can make it work right slowly-slowly :)

With this patch, you can already test carrier management but not yet
make a complete connection.

Relevant extract from logs:
<info> (ueagle-atm0): carrier now ON (device state 20)
<info> (ueagle-atm0): device state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40]

Signed-off-by: Pantelis Koukousoulas <>

8 years agoadsl: settings and initial "scaffolding"
Pantelis Koukousoulas [Tue, 17 May 2011 18:03:18 +0000]
adsl: settings and initial "scaffolding"

This patch adds the settings code (NMSettingAdsl) and the initial
"scaffolding" i.e., a tiny stub version of NMDeviceAdsl and the
udev handler code to get the device detected.

With this patch you should be able to see an atm device being detected
by networkmanager in the logs, although of course it doesn't
do anything useful yet.

Extract from the logs:

 [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device detected from udev. Adding ..
(ueagle-atm0): failed to look up interface index
(ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1)
(ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2
(ueagle-atm0): now managed
(ueagle-atm0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
(ueagle-atm0): deactivating device (reason: 2).
 [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to lookup interface index
 [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): (ueagle-atm0): device is available,

In this version, we hack the nm-device.c:nm_device_get_priority() to get better priority
instead of changing the DeviceType enum.

Signed-off-by: Pantelis Koukousoulas <>

8 years agopo: updated German translation (bgo #676229)
Christian Kirbach [Fri, 18 May 2012 08:41:31 +0000]
po: updated German translation (bgo #676229)

8 years agoifnet: handle 'biosdevname' interface names better (bgo #674765) (lp:962587)
Jiří Klimeš [Thu, 10 May 2012 13:40:48 +0000]
ifnet: handle 'biosdevname' interface names better (bgo #674765) (lp:962587)

Finding out interface type from interface name string is fragile. It is easily
broken, e.g. by biosdevname changing interface names to em<n> or p<n>*p<n>.
Sadly, Gentoo network configuration scripts are rather stupid, using format:
The entries interface|mac|essid|apmac are basically indistinguishable. It's not
possible to say whether 'p1p1' is an interface or SSID, for example.

Fix the current behaviour a bit by checking whether the string is an interface.
If so, and it is not a Wi-Fi one, set the connection type as wired. Else it is
regarded as wireless.

8 years agobluetooth: move device logic to bluez manager
Dan Williams [Fri, 11 May 2012 16:17:18 +0000]
bluetooth: move device logic to bluez manager

To simplify NMManager and to make use of the new connection provider
functionality, move the logic for when a paired Bluetooth device
is actually usable for network connections or not into the bluez
manager and out of NMManager.  The general direction should be towards
moving this sort of logic out of the manager and into the device
specific stuff, like we did with the WiMAX bits, so we can make
stuff into plugins.

8 years agocore: fix ifindex value checks
Dan Williams [Tue, 15 May 2012 14:44:49 +0000]
core: fix ifindex value checks

Kernel ifindexes are always greater than zero (see dev_new_index()
in net/core/dev.c).  Also don't bother warning about ifindex
lookup failures for devices we know aren't kernel network interfaces.

8 years agocore: move connection provider interface to src/
Dan Williams [Thu, 17 May 2012 18:21:47 +0000]
core: move connection provider interface to src/

8 years agoUse GLIB_VERSION_MIN_REQUIRED to work around GValueArray deprecation
Dan Winship [Thu, 17 May 2012 13:46:24 +0000]
Use GLIB_VERSION_MIN_REQUIRED to work around GValueArray deprecation

GValueArray is deprecated as of GLib 2.32, but we need to use it for
dbus-glib stuff. So use the new GLIB_VERSION_MIN_REQUIRED macro to
prevent those warnings.

8 years agocore: don't print carrier messages if device is unmanaged
Dan Williams [Wed, 16 May 2012 23:10:24 +0000]
core: don't print carrier messages if device is unmanaged

8 years agoconfigure: fix libsoup check
Thomas Bechtold [Sun, 13 May 2012 09:16:44 +0000]
configure: fix libsoup check

8 years agoolpc-mesh: force use of WEXT
Daniel Drake [Wed, 16 May 2012 17:51:03 +0000]
olpc-mesh: force use of WEXT

The libertas driver now uses nl80211 for mesh, and wifi-utils chooses to
use wifi-utils-nl80211.

The wifi-utils-nl80211 code does not have implementations for
mesh_get_channel/mesh_set_channel and this breaks mesh networking.
Adding these methods under nl80211 is a little painful.

For now, force use of wifi-utils-wext to restore mesh networking.

8 years agodhcp: allow some same-state transitions (rh #801744)
Dan Williams [Wed, 16 May 2012 03:45:27 +0000]
dhcp: allow some same-state transitions (rh #801744)

The DHCP code usually ignores dhclient state transitions to the
same state it's currently in.  This turns out to be wrong, since
dhclient will use the same reason code (which NM uses for the
state value) for operations like RENEW and REBIND.  i.e. you'll
see states like this:

RENEW (first renew)
RENEW (second renew)
RENEW (third renew)

Therefore to ensure we trigger dispatcher scripts and internal
housekeeping code for renewals we need to make sure we process
these events even though they use the same state as the previous

8 years agoRevert "dhcp: allow some same-state transitions (rh #810744)"
Dan Williams [Wed, 16 May 2012 03:54:14 +0000]
Revert "dhcp: allow some same-state transitions (rh #810744)"

This reverts commit a5dfb5a48274cc6fe9052162456dcc9237eedda4.

Screwed up the bug #.  Dyslexia?  Maybe...

8 years agodhcp: allow some same-state transitions (rh #810744)
Dan Williams [Wed, 16 May 2012 03:45:27 +0000]
dhcp: allow some same-state transitions (rh #810744)

The DHCP code usually ignores dhclient state transitions to the
same state it's currently in.  This turns out to be wrong, since
dhclient will use the same reason code (which NM uses for the
state value) for operations like RENEW and REBIND.  i.e. you'll
see states like this:

RENEW (first renew)
RENEW (second renew)
RENEW (third renew)

Therefore to ensure we trigger dispatcher scripts and internal
housekeeping code for renewals we need to make sure we process
these events even though they use the same state as the previous

8 years agocore: silently ignore duplicates in NMIP[46]Config
Dan Winship [Mon, 14 May 2012 14:35:39 +0000]
core: silently ignore duplicates in NMIP[46]Config

The various nm_ip[46]_config_add_* routines were inconsistent in their
behavior when trying to add a duplicate item: add_address() and
add_route() would add it anyway; add_nameserver() and add_wins() would
g_return_if_fail(); and add_domain() and add_search() would return
silently. Update to use the "return silently" behavior everywhere.

In particular: if we get an RDNSS message listing the same nameserver
twice, don't cause a warning. (rh #820752)

8 years agokeyfile: be more helpful about the property that's invalid or missing
Dan Williams [Mon, 14 May 2012 22:41:50 +0000]
keyfile: be more helpful about the property that's invalid or missing

8 years agosettings: fix example plugin LDFLAGS
Dan Williams [Mon, 14 May 2012 20:51:31 +0000]
settings: fix example plugin LDFLAGS

C&P error.

8 years agodbus: fix Modem interface permissions
Dan Williams [Mon, 14 May 2012 19:50:17 +0000]
dbus: fix Modem interface permissions

Doesn't really matter since everything to NM is allowed in the
at_console block, but just for correctness fix it.

8 years agosettings: add nm_connection_provider_get_connections() to connection provider interface
Dan Williams [Thu, 10 May 2012 22:03:07 +0000]
settings: add nm_connection_provider_get_connections() to connection provider interface

Will be used by some other stuff.

8 years agosupplicant: handle interface state 'disabled'
Dan Williams [Fri, 11 May 2012 22:15:40 +0000]
supplicant: handle interface state 'disabled'

Been around for a while; happens if the interface goes away or is
rfkilled.  Recognize it for now but we don't do anything with it

8 years agopo: updated Indonesian translation (bgo #675738)
Andika Triwidada [Fri, 11 May 2012 08:22:48 +0000]
po: updated Indonesian translation (bgo #675738)

8 years agopo: updated Polish translation (bgo #675834)
Piotr Drąg [Fri, 11 May 2012 08:12:00 +0000]
po: updated Polish translation (bgo #675834)

8 years agobackends: fix nscd condrestart for systemd installations (rh #805531)
Jiří Klimeš [Thu, 10 May 2012 15:40:18 +0000]
backends: fix nscd condrestart for systemd installations (rh #805531)

This also inhibits pointless error message that '/etc/init.d/nscd condrestart'
could not be spawned.

8 years agocli: fix 'nm -nocheck con up'
Jiří Klimeš [Wed, 9 May 2012 10:54:09 +0000]
cli: fix 'nm -nocheck con up'

When '-nocheck' option was used, NMClient object was created later in the
operation process.
This caused that the callback in nm_client_activate_connection() was not
called. It's fixed by creating NMClient early.

8 years agocli: show progress in --pretty mode for 'nmcli con up'
Jiří Klimeš [Wed, 9 May 2012 10:35:27 +0000]
cli: show progress in --pretty mode for 'nmcli con up'

We need to use a workaround for VPN connection state. There is a bug somewhere
causing that vpn-state-changed signal is not issued on active VPN connection.
Debugging showed that D-Bus PropertiesChanged and VpnStateChanged signals are
not processed properly. That's why libnm-glib's VPN connection object is not
updated. The issue may lie in libnm-glib or even in dbus-glib.
I wasn't able to get VpnStateChanged signal via dbus-glib
(dbus_g_proxy_add_signal() and dbus_g_proxy_connect_signal()), however received
the signal successfully using GDBus.

Until the issue is analyzed and fixed, we need to ask for VPN state of active
VPN connection every second in order to show progress and exit correctly.

8 years agocli: show progress in --pretty mode for 'nmcli dev disconnect'
Jiří Klimeš [Thu, 3 May 2012 09:54:52 +0000]
cli: show progress in --pretty mode for 'nmcli dev disconnect'

8 years agoexamples: add an example system settings plugin
Dan Williams [Mon, 7 May 2012 20:19:09 +0000]
examples: add an example system settings plugin

8 years agowifi: attempt to use same kernel API wpa_supplicant does (bgo #675017)
Dan Williams [Fri, 4 May 2012 19:26:10 +0000]
wifi: attempt to use same kernel API wpa_supplicant does (bgo #675017)

Some drivers (ipw2x00) support capabilities reporting via nl80211 but
absolutely nothing else.  NM was only checking for capabilities
when deciding whether or not to use nl80211 to communicate with the
driver for associated AP, signal strength, and channel info, and that
clearly fails with half-implementations of nl80211 in the kernel.

Instead, match the logic that wpa_supplicant uses to determine whether
to stick with nl80211 or fall back to WEXT.  For these drivers
NM will now fall back to WEXT and should return to the behavior we
had with 0.9.2 for these devices.

8 years agowifi: work around some scan failures at startup
Dan Williams [Wed, 2 May 2012 22:16:35 +0000]
wifi: work around some scan failures at startup

mac80211 drivers don't like being asked to scan when they are already
scanning, and it's pretty impossible to not race with internal
supplicant scanning.  NM requests a scan immediately after the
supplicant interface gets created, and that scan request usually
succeeds.  But since the supplicant's scan request method returns
when the kernel *starts* the scan, not when the scan is finished,
a second scan that NM would immediately request in
request_wireless_scan() would often fail as the card was already

The second scan was requested immediately becuase the SCAN_INTERVAL_MIN
was zero, which was set to zero to intentionally request two scans
to work around drivers that would fail the first scan because they
are stupid.

Well, let's just penalize stupid drivers by *possibly* making the
initial connection take a few more seconds due to the change of
SCAN_INTERVAL_MIN.  But what we're really doing here is not asking
for the second scan right after the first one is requested, since
that will almost always fail for most drivers, but request the
second one after the supplicant says the scan is done.

Second, if for some reason the supplicant reports that the scan failed,
don't make the next scan take longer; just queue it up without backing
off so we can retry the scan sooner.

8 years agowifi: don't report supplicant interface is READY until we've read properties
Dan Williams [Wed, 2 May 2012 18:04:23 +0000]
wifi: don't report supplicant interface is READY until we've read properties

NMDeviceWifi and a few other things expect the interface will
move from STARTING to READY and then on to other states.  But the
state was getting set to the actual supplicant interface state
immediately when the first properties were read (which include
the State property) and thus the READY state got bypassed.  But
we also want to read stuff like the capabilities before letting
the interface be used.

So first, ensure the supplicant interface object actually uses the
READY state like its callers expect, and second, don't set the
READY state until we actually know what we need to know about it.

8 years agowifi: probe-scan for hidden SSIDs
Dan Williams [Wed, 2 May 2012 16:41:47 +0000]
wifi: probe-scan for hidden SSIDs

8 years agolibnm-util: add 'hidden' property to the wireless setting
Dan Williams [Wed, 2 May 2012 16:40:32 +0000]
libnm-util: add 'hidden' property to the wireless setting

Used as a hint to indicate the network is not broadcasting the SSID
and that workarounds should be used for more reliable connection.

8 years agocore: pass connection provider to devices
Dan Williams [Wed, 2 May 2012 15:28:16 +0000]
core: pass connection provider to devices

8 years agocore: add connection provider interface
Dan Williams [Wed, 2 May 2012 15:25:58 +0000]
core: add connection provider interface

Allows better encapsulation of the functionality of the NMSettings
object that we want to expose to the device class.  They don't need
the whole object so to keep things simple and contained we'll just
give them a smaller interface to use.

8 years agowifi: cache number of available scan SSIDs
Dan Williams [Tue, 1 May 2012 22:59:35 +0000]
wifi: cache number of available scan SSIDs

Which we'll use later for better handling of non-broadcasting
networks by probing for them.

8 years agorelease: update NEWS
Dan Williams [Tue, 1 May 2012 17:59:11 +0000]
release: update NEWS

8 years agotrivial: fix distcheck in libnm-glib
Dan Williams [Mon, 30 Apr 2012 21:19:46 +0000]
trivial: fix distcheck in libnm-glib

8 years agoman: document 'nmcli nm wimax' in nmcli's man page
Jiří Klimeš [Mon, 30 Apr 2012 11:50:15 +0000]
man: document 'nmcli nm wimax' in nmcli's man page

8 years agocli: add a command for listing permissions - nmcli nm permissions
Jiří Klimeš [Mon, 30 Apr 2012 09:50:26 +0000]
cli: add a command for listing permissions - nmcli nm permissions

8 years agoman: make nmcli man page more readable
Jiří Klimeš [Mon, 30 Apr 2012 09:02:28 +0000]
man: make nmcli man page more readable

There are a few changes making the text less awkward after a native speaker's

8 years agocli: trivial, fix up spacing
Jiří Klimeš [Sat, 28 Apr 2012 20:54:02 +0000]
cli: trivial, fix up spacing

8 years agocli: add 'connect to SSID' feature: nmcli dev wifi connect <SSID> ...
Jiří Klimeš [Sat, 28 Apr 2012 21:32:21 +0000]
cli: add 'connect to SSID' feature: nmcli dev wifi connect <SSID> ...

This is similar to clicking a Wi-Fi network's SSID in a GUI applet.
The command does this:
- creates new connection (fills the user data specified via options, the
  connection is then completed with default parameters by NM)
- and then activates the connection on a Wi-Fi device.

WPA-Enterprise is not supported as it requires a plethora of parameters and
they can't be obtained automatically.
Also, the created connection uses 'auto' IP method, which means that if the
Wi-Fi network doesn't support DHCP, the connection will albeit be created,
however the activation will fail (IP configuration won't be available).

8 years agocore: ensure carrier is always on for devices that don't support detection (rh #816719)
Dan Williams [Sat, 28 Apr 2012 16:48:01 +0000]
core: ensure carrier is always on for devices that don't support detection (rh #816719)

We broke this when splitting NMDeviceWired out of NMDeviceEthernet.

8 years agopo: updated Lithuanian translation (bgo #675020)
Aurimas Černius [Sat, 28 Apr 2012 16:31:14 +0000]
po: updated Lithuanian translation (bgo #675020)

8 years agolibnm-glib: fix build on older glib without g_clear_object()
Dan Williams [Fri, 27 Apr 2012 20:03:29 +0000]
libnm-glib: fix build on older glib without g_clear_object()

8 years agocore: log whether WEXT is enabled or not (bgo #674650)
Dan Williams [Thu, 26 Apr 2012 18:38:41 +0000]
core: log whether WEXT is enabled or not (bgo #674650)

Now that we've encountered this twice with distros disabling WEXT
but apparently not realizing it kills staging and out-of-kernel
drivers like wl.o, make it a log message so we don't have to go
hunting for build-time logfiles.

8 years agocore: replace strcpy() with g_strlcpy()
Dan Winship [Thu, 26 Apr 2012 13:25:58 +0000]
core: replace strcpy() with g_strlcpy()

When copying device names into ioctl structs, we know that the device
names are of valid length, so we were using strcpy(). But you can't
prove that they're short enough just looking at the local code, so
some code analysis tools warn about a potential buffer overflow.. So
use g_strlcpy() instead.

8 years agoifcfg-rh: fix vlan DEVICE parsing
Dan Winship [Wed, 25 Apr 2012 18:40:04 +0000]
ifcfg-rh: fix vlan DEVICE parsing

A vlan DEVICE name must be either $(OTHERDEVICE).$(VLAN_ID) or
vlan$(VLAN_ID). Enforce that. In particular, don't:
(a) crash if the name has no "." and doesn't start with "vlan",
(b) loop forever if the $(VLAN_ID) part is non-numeric, or
(c) silently ignore non-numberic characters after the $(VLAN_ID).

8 years agolibnm-glib: add "object-creation-failed" signal to NMObject
Jiří Klimeš [Tue, 24 Apr 2012 14:23:27 +0000]
libnm-glib: add "object-creation-failed" signal to NMObject

The signal is private for libnm-glib and should not be used externally.
It is emitted when there's an error while creating an object.
In addition, this commit makes use of the signal in NMClient to ensure
that the callbacks are always called for nm_client_activate_connection()
and nm_client_add_and_activate_connection().

8 years agocore: notify that "active-connection" property changed on NMDevice
Jiří Klimeš [Tue, 24 Apr 2012 14:27:00 +0000]
core: notify that "active-connection" property changed on NMDevice

This is necessary so that PropertiesChanged D-Bus signal is properly

8 years agobuild: report whether WEXT is enabled or not (bgo #674650)
Dan Williams [Tue, 24 Apr 2012 18:07:49 +0000]
build: report whether WEXT is enabled or not (bgo #674650)

8 years agolibnm-glib: ensure object cache is cleared when NM stops (bgo #674473)
Dan Williams [Mon, 23 Apr 2012 22:07:18 +0000]
libnm-glib: ensure object cache is cleared when NM stops (bgo #674473)

Otherwise if a client holds references to the objects (or in the
JavaScript case, uses deferred garbage collection) they'll still
be in the cache when NM restarts, and the old object may have the
same path as some new object, which isn't good.

8 years agolibnm-glib: discard devices and active connections when NM goes down
Dan Winship [Mon, 23 Apr 2012 16:20:14 +0000]
libnm-glib: discard devices and active connections when NM goes down

When NMClient changes state to "not running", don't just unref all the
devices and connections: emit notify::active-connections and
device-removed signals too, so the app will drop its copies of them.

8 years agolibnm-glib: NULL out priv fields on dispose()
Dan Winship [Mon, 23 Apr 2012 15:02:48 +0000]
libnm-glib: NULL out priv fields on dispose()

In some situations, objects might get used after being disposed, so
clear out their various priv fields so we don't try to access unreffed
objects, freed strings, etc.

8 years agolibnm-glib: protect against potentially NULL changed property values (rh #808784)
Dan Williams [Mon, 23 Apr 2012 19:30:42 +0000]
libnm-glib: protect against potentially NULL changed property values (rh #808784)

No idea *why* they're NULL, unless perhaps that dbus-glib can't demarshal
the variants for some reason, but until we know why at least log the
problem so we know what properties the issue might affect.

8 years agolibnm-glib: ensure NMRemoteConnection signals are disconnected (bgo #674484) (lp...
Dan Williams [Mon, 23 Apr 2012 18:40:43 +0000]
libnm-glib: ensure NMRemoteConnection signals are disconnected (bgo #674484) (lp:949743)

If a client keeps the connection around after NMRemoteSettings is done
with it (and has emitted 'removed' for that connection) then the
RemoteSettings object was still registered to receive signals for
that connection.  To prevent clients from being able to screw up
the RemoteSettings, disconnect any signals it may be listening for
when the connection is removed.  (it should be doing that anyway)

8 years agotrivial: fix spacing
Dan Williams [Fri, 20 Apr 2012 14:57:22 +0000]
trivial: fix spacing

8 years agocore: don't fight with the kernel over the default IPv6 route
Dan Winship [Thu, 19 Apr 2012 18:27:12 +0000]
core: don't fight with the kernel over the default IPv6 route

The kernel wants there to be a default route over every RA-ed IPv6
interface, and it gets confused and annoyed if we remove that default
route and replace it with our own (causing it to effectively drop all
further RAs on the floor, which is particularly bad if some of the
information in the earlier RA had an expiration time).

So, rather than replacing the kernel's default route(s), just add an
additional one of our own, with a lower (ie, higher priority) metric.

8 years agocore: improve handling of POSIX signals using sigwait() (rh #739836)
Jiří Klimeš [Mon, 16 Apr 2012 11:30:53 +0000]
core: improve handling of POSIX signals using sigwait() (rh #739836)

There are multiple ways how to handle standard unix signals. They work quite
well for a single-threaded application. However, signal handling in a multi-
threaded app becomes tricky. And, the most safe way is to use sigwait() function
in a dedicated thread, which allows us to process the signals synchronously and
thus avoid various nasty problems.

A few useful links:,2

8 years agoifnet: do not call g_strv_length() on NULL
Jiří Klimeš [Thu, 12 Apr 2012 11:26:22 +0000]
ifnet: do not call g_strv_length() on NULL

8 years agoifnet: fix quote handling for global data (bgo #673548)
Mu Qiao [Thu, 5 Apr 2012 02:12:37 +0000]
ifnet: fix quote handling for global data (bgo #673548)

8 years agowifi: check the driver reports any encryption caps with nl80211 (bgo #673717)
Mathieu Trudel-Lapierre [Thu, 12 Apr 2012 10:01:28 +0000]
wifi: check the driver reports any encryption caps with nl80211 (bgo #673717)

Some drivers, such as ipw2200 doesn't report any encryption with newer kernels.
See also

8 years agoFix a few misc issues noticed by Coverity
Dan Winship [Thu, 5 Apr 2012 17:30:09 +0000]
Fix a few misc issues noticed by Coverity

8 years agopo: updated Swedish translation (bgo #673234)
Daniel Nylander [Tue, 3 Apr 2012 13:47:43 +0000]
po: updated Swedish translation (bgo #673234)

8 years agopo: updated Esperanto translation (bgo #673353)
Kristjan SCHMIDT [Tue, 3 Apr 2012 13:39:22 +0000]
po: updated Esperanto translation (bgo #673353)

8 years agopo: updated Galician translation (bgo #672597)
Fran Diéguez [Tue, 3 Apr 2012 13:31:20 +0000]
po: updated Galician translation (bgo #672597)

8 years agoifcfg-rh: clear MACADDR before writing it in wired setting (bgo #672646)
Jiří Klimeš [Tue, 3 Apr 2012 12:57:31 +0000]
ifcfg-rh: clear MACADDR before writing it in wired setting (bgo #672646)

Else it's not possible to delete Cloned MAC (e.g. in the editor).

8 years agolibnm-glib: initialize GError, else invalid free() crash can occur (rh #809123)
Jiří Klimeš [Mon, 2 Apr 2012 14:37:55 +0000]
libnm-glib: initialize GError, else invalid free() crash can occur (rh #809123)

8 years agotrivial: whitespace fixes
Jiří Klimeš [Mon, 2 Apr 2012 11:08:19 +0000]
trivial: whitespace fixes

8 years agoRevert "libnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh ...
Jiří Klimeš [Mon, 2 Apr 2012 10:34:36 +0000]
Revert "libnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh #806664)"

This reverts commit dd0460697c4e281fe277b53916d5251332e1aafc.

The commit dd0460697c4e281fe277b53916d5251332e1aafc make nm_remote_settings_new()
create the NMRemoteSettings object synchronously. It fixed getting properties,
but undid the previous ability to initialize the object asynchronously.
It can be reverted now, because a4f450aa0bf087453a8d605db81a83368cbe3b0a commit
ensure initialization in get_property() calls.

8 years agocore: call is_adhoc_wpa() only after we check '802-11-wireless' setting
Jiří Klimeš [Mon, 2 Apr 2012 10:28:05 +0000]
core: call is_adhoc_wpa() only after we check '802-11-wireless' setting

This prevents assertion while checking a connection that is not a wireless one.

8 years agopo: updated Swedish translation (bgo #671096)
Daniel Nylander [Fri, 30 Mar 2012 11:17:11 +0000]
po: updated Swedish translation (bgo #671096)

8 years agopo: updated Slovenian translation (bgo #671775)
Matej Urbančič [Fri, 30 Mar 2012 11:09:57 +0000]
po: updated Slovenian translation (bgo #671775)

8 years agoppp: don't use struct ifpppstatsreq that was removed from linux/ip_ppp.h
Jiří Klimeš [Wed, 28 Mar 2012 14:42:24 +0000]
ppp: don't use struct ifpppstatsreq that was removed from linux/ip_ppp.h

in recent kernels.

We can use ifreq and ppp_stats structures separately. They needn't have to
to be packed in a structure.

8 years agolibnm-glib: more ensure_inited() fixing
Dan Winship [Wed, 28 Mar 2012 13:06:12 +0000]
libnm-glib: more ensure_inited() fixing

We need to do _nm_object_ensure_inited() /
_nm_remote_settings_ensure_inited() from the get_property()
implementations; in most cases, get_property() just calls another
accessor method (which will call _nm_object_ensure_inited()), but in a
few places, it reads priv->whatever directly, so we need to make sure
that it's valid.

8 years agolibnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh #806664)
Jiří Klimeš [Tue, 27 Mar 2012 20:36:55 +0000]
libnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh #806664)

The object was not initialized after creation in nm_remote_settings_new(). This
was a regression caused by 762df85234e7a042a2a5d31053e6cc273ae3e2ec.

8 years agoifupdown: add missing test18-wired-static-verify-ip6 to
Jiří Klimeš [Tue, 27 Mar 2012 13:55:21 +0000]
ifupdown: add missing test18-wired-static-verify-ip6 to

8 years agolibnm-glib: ensure bindings-created NMClient object work (rh #802536)
Jiří Klimeš [Tue, 27 Mar 2012 12:38:48 +0000]
libnm-glib: ensure bindings-created NMClient object work (rh #802536)

Most of the stuff was done by 762df85234e7a042a2a5d31053e6cc273ae3e2ec.
But to allow this piece of code:

from gi.repository import NMClient
nmclient = NMClient.Client()
print nmclient.get_active_connections()

we also need to set "dbus-path" property in NMClient constuctor(),
else parent NMObject is not properly constructed.

8 years agoFix format string vulnerability in verify ()
Michael Biebl [Sat, 24 Mar 2012 22:05:41 +0000]
Fix format string vulnerability in verify ()

which caused a build failure when compiling with -Werror=format-security

8 years agodocs: fixups for new settings
Dan Williams [Sat, 24 Mar 2012 00:01:41 +0000]
docs: fixups for new settings