Commit graph

2132 commits

Author SHA1 Message Date
Dan Williams
e3ba9162c2 supplicant: fix state handling after READY has been reached
We only want to prevent regression to > READY after READY has
been reached, since the interface state will track the supplicant
connection state which legitimately jumps around.
2010-12-11 12:33:15 -06:00
Dan Williams
ea16af7c18 supplicant: fix up return arguments for Disconnect and RemoveNetwork 2010-12-11 12:31:10 -06:00
Dan Williams
1cd17ac896 supplicant: fix leak updating BSS properties 2010-12-11 11:59:40 -06:00
Dan Williams
fd5e8c2f05 core: fix leak parsing config file 2010-12-10 18:50:49 -06:00
Dan Williams
a752140c8f Merge remote branch 'origin/new-supplicant'
This branch now requires wpa_supplicant 0.7 or later with the new
D-Bus interface enabled.  It also prefers the "nl80211" supplicant
driver over the WEXT one, but will ask the supplicant to fall back
to the WEXT driver if the device in question does not support the
kernel's nl80211/cfg80211 stack.
2010-12-07 14:23:39 -06:00
Dan Williams
12345affa5 wifi: move wireless_qual_to_percent() to get rid of prototype
Now that it's only used in one place we can get rid of the prototype.
2010-12-07 14:18:44 -06:00
Dan Williams
a08dd2c39d supplicant: fix handling when supplicant cannot be service activated
If the supplicant cannot be service activated, wait until it shows up
on the bus instead of sitting around doing nothing.  This fixes a small
regression introduced when the _READY state was added to the supplicant
interface object.
2010-12-07 13:58:49 -06:00
Dan Williams
9e9a46b405 wifi: remove useless warning 2010-12-06 15:55:30 -06:00
Canek Peláez Valdés
740dc88cb3 gentoo: handle both systemd and OpenRC loopback init at runtime
See Gentoo #318365
2010-12-06 09:36:28 -06:00
Jiří Klimeš
f6f8ef2f8a dns: fix a crash due to uninitialized nis_domain (novell #655685)
Reported and tested by Raymond Wooninck. Thanks!
2010-11-24 12:51:08 +01:00
Dan Williams
4b37101ef4 core: suppress error message when user settings service is not active
Don't bother trying to initialize the user settings proxy when it
isn't even active.  Would trigger a warning to syslog if PolicyKit
permissions changed via changes to /usr/share/polkit-1/actions/.
2010-11-23 22:17:21 -06:00
Dan Williams
608783c5b7 core: handle device removal when properties are unreadable
By the time we get the udev device removal notification we may not
be able to read properties, since the device has already been
removed from sysfs.  That means we can't get the ifindex, so we need
to fall back to the interface name.  But we always want to prefer
the ifindex since that will never change as long as the device is
connected, unlike the interface name.
2010-11-23 13:11:44 -06:00
Jiří Klimeš
4b022ed32b core: correct TIMESTAMP type; fixes potential crash when time() is 32bit
The Crash appeared on some platforms in glib while processing variable
arguments.
2010-11-23 19:06:58 +01:00
Dan Williams
bfbb71b763 wifi: update signal quality calculation for new supplicant interface 2010-11-23 00:02:46 -06:00
Dan Williams
fb6cde508c supplicant: convert blob handling to new supplicant interface 2010-11-22 22:34:04 -06:00
Dan Williams
f5e084c668 supplicant: convert association paths to new supplicant interface 2010-11-22 09:05:09 -06:00
Dan Williams
6ecb45ddf0 wifi: convert scanning to new supplicant interface 2010-11-22 08:40:21 -06:00
Dan Williams
848f9f4261 wifi: convert parts of association path to new supplicant interface 2010-11-22 08:30:13 -06:00
Dan Williams
8bbbd3edc3 wifi: convert AP handling to new supplicant interface 2010-11-22 08:25:09 -06:00
Dan Williams
528e087608 wifi: handle new supplicant AP property formats 2010-11-22 08:22:50 -06:00
Mikhail Efremov
92b58e56f5 dhcp: ensure that dhcp client is exited
On restart ensure that the client we're trying to kill has
actually exited even if it's not our child.
2010-11-19 16:52:55 -06:00
Mathieu Trudel-Lapierre
3951942fa1 wired: fix uninitialized variable 2010-11-19 16:17:40 -06:00
Dan Williams
02a1da41c6 supplicant: convert add/remove to new supplicant dbus interface 2010-11-18 17:02:04 -06:00
Dan Williams
3992c7db50 dhcpcd: prevent dhcpcd from messing with routing (bgo #634983)
Since NM is already handling that.
2010-11-18 16:30:00 -06:00
Dan Williams
cbb0d6d116 build: create NM state directory at install time 2010-11-08 09:09:54 -06:00
Wulf C. Krueger
3b4e9dd75e backends: add Exherbo support (bgo #634058) 2010-11-05 13:41:20 -05:00
Dan Williams
3d8b6acaba core: revert API parts of fe493ec91e
And add a default autoconnect retries value.
2010-11-03 13:23:09 -05:00
Jiří Klimeš
fe493ec91e core: add configurable auto connection retries (bgo #628825)
Presently, when automatic connecting fails, the connection is marked
as invalid and is not retried again. This commit adds a configuration
parameter to specify how many times the connection should be re-tried.
2010-11-03 16:22:55 +01:00
Jiří Klimeš
607350294d core: update timestamp in active system connections every 5 mins (bgo #583756)
This patch updates timestamps in system connections. The update occurs on
connection activation and then periodically every 5 mins while the connection
is active. It only works for plugins having write support and for writable
connections (not read-only).
2010-11-03 16:07:15 +01:00
Jiří Klimeš
bc76e40dec trivial: make connection activating error more precise 2010-10-26 13:46:17 +02:00
Dan Williams
8b006f331d dhcp: add support for Fedora dhclient RFC3442 routes (rh #639935)
Add support for Fedora's dhclient's built-in RFC3442 classless static
routes format.

Since the Fedora format uses the same name as the dhcpcd format, we
need to refactor a bunch of the code to ensure we can distinguish
between the types.  Do this at runtime now by consolidating the
classless static routes parsing code into the DHCP Client base class
and rework the unit tests so that we can test all variations of the
classless static route parsing code at the same time.

This also fixes a bug with the dhcpcd classless static route
gateway handling that would return the wrong gateway address.

Many thanks to Jiri Popelka from Red Hat for the initial patch
and explanations.
2010-10-21 13:34:40 -05:00
Dan Williams
b368b8fea3 Merge remote branch 'origin/sup-rework' 2010-10-18 18:40:42 -05:00
Dan Williams
8310593ce4 core: ignore authorization for sleep/wake requests (but restrict to root) (rh #638640)
Everyone uses pm-utils still for sleep/wake support, and that's
traditionally how NM was put to sleep and woken up.  But pm-utils
uses dbus-send without --print-reply so dbus-send quits immediately
after sending the message.  That doesn't give NM enough time to
get the senders UID and thus validate the request, so the request
gets denied, and sometimes NM stays asleep after the machine is
woken up.

Instead, don't get the sender's UID and try to authorize it, but
just let the request go through.  Rely on D-Bus permissions to
make sure that only root can call sleep/wake methods.
2010-10-15 10:33:34 -05:00
Dan Williams
f532f41c02 supplicant: ratelimit supplicant activation
If the supplicant dies a number of times within a short period of
time, make it go sit in the corner for a bit instead of continuously
trying to start it and have it die again.

Instead of just exposing a "running" value, instead make a meta
"available" value that's a combination of whether the supplicant
is actually running plus whether we want to talk to it right now
or not.
2010-10-12 14:18:42 -05:00
Dan Williams
39e111e5eb supplicant: ignore unknown wpa_supplicant states
Don't treat them as DISCONNECTED.
2010-10-11 20:35:54 -05:00
Dan Williams
48e37de3a4 supplicant: prevent a race condition due to D-Bus activation
interface_add() could get called from two places: by the wifi/eth
device class when activating (which if the supplicant isn't yet
running will D-Bus activate it) and from the NameOwnerChanged
handler for the wpa_supplicant dbus service smgr_running_cb().

So if the supplicant wasn't running, nm_supplicant_interface_new()
would call interface_add() to bring the supplicant to life via
activation, then go on and create priv->iface_proxy.  When the
supplicant appeared and D-Bus sent the NameOwnerChanged,
smgr_running_cb() would also call interface_add(), creating a
second priv->iface_proxy.  The first one got lost and lived after
its parent NMSupplicantInterface was killed, and could still
respond to signals over the bus.

Prevent that by adding another state, STARTING, that indicates
that we've already started talking to the supplicant.  Also be
extra paranoid about disconnecting signal handlers on the proxy.
2010-10-11 20:30:40 -05:00
Dan Williams
5858c6103e supplicant: make sure we remove the right interface
It shouldn't ever happen that two interface objects for the same
network interface are active at the same time, but make sure we
yell if it does.
2010-10-11 20:27:51 -05:00
Alex Vogt
d40c81b06a linexa: add basic Linexa support 2010-10-08 23:03:10 -05:00
Dan Williams
be97e7f104 build: include <config.h> for kill(2), isblank(3), and isascii(3)
config.h defines _GNU_SOURCE, which in turn defines the bits necessary
for kill, isblank, and isascii.  So wherever we use those, we need
to make sure config.h is included.
2010-10-08 22:46:55 -05:00
Dan Williams
bbf3f12d7b policy: prevent hostname duplication in /etc/hosts 2010-10-07 18:24:59 -05:00
Dan Williams
ad3cb6d832 policy: add testcases for removing stale hosts mappings (bgo #629020) (rh #630146) 2010-10-07 18:14:29 -05:00
Dan Williams
ee9ce6027b policy: preserve custom hostnames on local-mapping lines (rh #627269)
Try to preserve custom hostnames (ie, anything not a localhost* variant,
the current hostname, or the previous hostname) when rewriting the
127.0.0.1/::1 localhost mapping lines.
2010-10-07 18:08:52 -05:00
Dan Williams
4a7c77ac95 dnsmasq: actually kill stale dnsmasq process
Interpret the return value of kill(2) correctly...
2010-10-07 14:07:58 -05:00
Dan Williams
35b1ed9082 dns: actually kill stale dnsmasq process
Interpret the return value of kill(2) correctly...
2010-10-07 14:07:52 -05:00
Dan Williams
8502f0c874 core: fix use-after-free getting user connections
G_SLICE debugging uncovered a use-after-free when freeing the
batched user connection settings callback list.  We don't
actually care about the DBusPendingCalls anyway, so just make
the list a counter and simplify the code in the process.
2010-10-07 13:52:51 -05:00
Dan Williams
03517015cc core: check address family, not route family 2010-10-07 12:09:17 -05:00
Dan Williams
aeeac548a8 dns: fix use-after-free in plugin error path 2010-10-07 12:04:41 -05:00
Dan Williams
82dd97c4b7 policy: ensure stale IP mappings are not left in /etc/hosts (bgo #629020) (rh #630146)
NM-added mappings for active IP addresses were not getting properly
removed when the address disappeared of NM quit, because the bits
of code that determine whether or not /etc/hosts should change were
not taking the disappearance of the IP address into account, and
were leaving the file unchanged.

To fix that, if there is no default IP address, but there are NM-added
IP address entries in /etc/hosts, make sure we update /etc/hosts and
remove them.
2010-10-07 00:29:44 -05:00
Martin Pitt
febb3d2cb4 system-settings: add timestamp to default auto wired connections (bgo #583756) 2010-10-06 17:14:54 -05:00
Martin Pitt
61e86600d5 dhcp: fix uninitialized variable usage with dhcp3 2010-10-06 17:12:10 -05:00