Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
a843431236 Revert "dhcp: allow some same-state transitions (rh #810744)"
This reverts commit a5dfb5a482.

Screwed up the bug #.  Dyslexia?  Maybe...
2012-05-15 22:54:14 -05:00
Dan Williams
a5dfb5a482 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:

BOUND
RENEW (first renew)
RENEW (second renew)
RENEW (third renew)
etc

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
event.
2012-05-15 22:50:36 -05:00
Dan Winship
cca40524ac 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)
2012-05-15 13:51:37 -04:00
Dan Williams
682cd73524 keyfile: be more helpful about the property that's invalid or missing 2012-05-15 09:19:31 -05:00
Dan Williams
9a3995daf6 settings: fix example plugin LDFLAGS
C&P error.
2012-05-14 15:51:31 -05:00
Dan Williams
89bf692c08 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.
2012-05-14 14:50:17 -05:00
Dan Williams
a5df15d75a settings: add nm_connection_provider_get_connections() to connection provider interface
Will be used by some other stuff.
2012-05-14 10:46:32 -05:00
Dan Williams
c3d3a3d16a 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
yet.
2012-05-11 17:15:40 -05:00
Andika Triwidada
4d74277edd po: updated Indonesian translation (bgo #675738) 2012-05-11 10:22:48 +02:00
Piotr Drąg
5b0adaa033 po: updated Polish translation (bgo #675834) 2012-05-11 10:12:00 +02:00
Jiří Klimeš
247bd27e1d 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.
2012-05-10 17:47:01 +02:00
Jiří Klimeš
c5d75dcdfa 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.
2012-05-09 14:19:11 +02:00
Jiří Klimeš
191da673a8 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.
2012-05-09 14:19:03 +02:00
Jiří Klimeš
d58c32d214 cli: show progress in --pretty mode for 'nmcli dev disconnect' 2012-05-09 13:37:28 +02:00
Dan Williams
5c0607d522 examples: add an example system settings plugin 2012-05-07 15:19:09 -05:00
Dan Williams
50435e1d5d 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.
2012-05-04 14:26:10 -05:00
Dan Williams
0e262e04e1 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
scanning.

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.
2012-05-04 13:48:54 -05:00
Dan Williams
565d1e2557 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.
2012-05-04 13:48:54 -05:00
Dan Williams
62888a13c9 wifi: probe-scan for hidden SSIDs 2012-05-02 17:33:17 -05:00
Dan Williams
bbd2c6e2e6 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.
2012-05-02 17:33:17 -05:00
Dan Williams
4980a6882b core: pass connection provider to devices 2012-05-02 17:33:17 -05:00
Dan Williams
4fe48b1273 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.
2012-05-02 17:33:17 -05:00
Dan Williams
1b40d82b74 wifi: cache number of available scan SSIDs
Which we'll use later for better handling of non-broadcasting
networks by probing for them.
2012-05-02 17:33:17 -05:00
Dan Williams
27fdc1a42c release: update NEWS 2012-05-01 12:59:11 -05:00
Dan Williams
51f37ca8d5 trivial: fix distcheck in libnm-glib 2012-04-30 16:19:46 -05:00
Jiří Klimeš
aa5ed42941 man: document 'nmcli nm wimax' in nmcli's man page 2012-04-30 13:50:15 +02:00
Jiří Klimeš
0a98d14e48 cli: add a command for listing permissions - nmcli nm permissions 2012-04-30 13:32:55 +02:00
Jiří Klimeš
e7bd96266b man: make nmcli man page more readable
There are a few changes making the text less awkward after a native speaker's
proofreading.
2012-04-30 10:29:36 +02:00
Jiří Klimeš
c878ad8214 cli: trivial, fix up spacing 2012-04-28 22:54:02 +02:00
Jiří Klimeš
38a988cb5e 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).
2012-04-28 22:33:30 +02:00
Dan Williams
a091c7aa0f core: ensure carrier is always on for devices that don't support detection (rh #816719)
We broke this when splitting NMDeviceWired out of NMDeviceEthernet.
2012-04-28 11:48:01 -05:00
Aurimas Černius
0c760292fe po: updated Lithuanian translation (bgo #675020) 2012-04-28 11:31:14 -05:00
Dan Williams
9c2c4e0591 libnm-glib: fix build on older glib without g_clear_object() 2012-04-27 15:04:29 -05:00
Dan Williams
8ed02c3039 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.
2012-04-26 13:40:07 -05:00
Dan Winship
d6a07c60e9 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.
2012-04-26 09:25:58 -04:00
Dan Winship
f378457f25 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).
2012-04-25 14:56:51 -04:00
Jiří Klimeš
7c7e8dc692 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().
2012-04-25 16:39:17 +02:00
Jiří Klimeš
f4419c9fb3 core: notify that "active-connection" property changed on NMDevice
This is necessary so that PropertiesChanged D-Bus signal is properly
issued.
2012-04-25 16:39:10 +02:00
Dan Williams
91f23df7ec build: report whether WEXT is enabled or not (bgo #674650) 2012-04-24 13:07:49 -05:00
Dan Williams
48981a6166 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.
2012-04-23 17:10:14 -05:00
Dan Winship
17d5973ef6 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.

https://bugzilla.gnome.org/show_bug.cgi?id=674473
2012-04-23 16:09:58 -04:00
Dan Winship
be18dd06cd 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.

https://bugzilla.gnome.org/show_bug.cgi?id=674473
2012-04-23 16:09:58 -04:00
Dan Williams
411cb36344 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.
2012-04-23 14:30:42 -05:00
Dan Williams
494f0a2e20 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)
2012-04-23 13:40:43 -05:00
Dan Williams
614c46f87b trivial: fix spacing 2012-04-20 09:57:22 -05:00
Dan Winship
77de91e5a8 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.

https://bugzilla.redhat.com/show_bug.cgi?id=785772
2012-04-19 16:25:13 -04:00
Jiří Klimeš
217c5bf6ac 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:
http://pubs.opengroup.org/onlinepubs/007904975/functions/sigwait.html
http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.genprogc%2Fdoc%2Fgenprogc%2Fsignal_mgmt.htm
http://www.linuxjournal.com/article/2121?page=0,2
http://www.redwoodsoft.com/~dru/unixbook/book.chinaunix.net/special/ebook/addisonWesley/APUE2/0201433079/ch12lev1sec8.html
2012-04-17 15:29:10 +02:00
Jiří Klimeš
21bc3ab517 ifnet: do not call g_strv_length() on NULL 2012-04-12 13:45:58 +02:00
Mu Qiao
5f4d238baa ifnet: fix quote handling for global data (bgo #673548) 2012-04-12 13:45:31 +02:00
Mathieu Trudel-Lapierre
de3353d58c 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 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/973241
2012-04-12 12:21:01 +02:00