Commit Graph

7207 Commits

Author SHA1 Message Date
Pavel Šimerda
110888c782 device: remove useless ipv6 route addition
Link-local multicast routes are handled by kernel. Just try pinging
ff02::1%eth0 on a clean system without IP configuration.
2012-09-25 15:03:32 -05:00
Dan Williams
78e9c564b2 keyfile: fix use-after-free in log messages 2012-09-25 15:03:13 -05:00
Dan Williams
5d503fe434 wifi: add "Speedport W 501V" to list of BSSID-locked SSIDs
"Speedport W 501V" is another widely-used SSID set on routers
given out by a German telecom.
2012-09-24 13:30:18 -05:00
Jiří Klimeš
07fc3dcb90 api: add NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED reason and use that 2012-09-24 10:38:26 +02:00
Jiří Klimeš
ece5e209cd core: VPN autoconnect feature (bgo #560471) (rh #483120)
We go through the SECONDARIES state where we check if there are some secondary
(VPN or other) UUIDs that are to be activated before progressing to ACTIVATED.
In case of an error with a secondary UUID or its activation, the base connection
can't activate successfully.
2012-09-24 10:38:26 +02:00
Jiří Klimeš
65ce4e52ef core: add some helper functions to activation request 2012-09-24 10:38:26 +02:00
Jiří Klimeš
8fde1b1d2a core: add nm_active_connection_get_name() for easy access to connection name 2012-09-24 10:38:18 +02:00
Jiří Klimeš
eb407143fd ifcfg-rh: read/write 'secondaries' property of 'connection' setting
as SECONDARY_UUIDS variable
2012-09-21 13:47:01 +02:00
Dan Williams
ee22af6961 wifi: handle supplicant's deauthentication disconnect reason
Recent versions of wpa_supplicant have a "DisconnectReason" property
that, upon a deauthentication event, contains an IEEE 802.11
"Reason Code" for why the disconnect may have occurred.  We may
want to use this in the future, so add the infrastructure to pass it
around to supplicant listeners.
2012-09-20 10:11:36 -05:00
Dan Williams
80122cf962 wifi: request new PSK if disconnected during the 4-way handshake
Most often, a disconnect during the 4-way handshake means that the
WPA PSK is wrong (though not always).  In that case, ask the user
for a new password.
2012-09-20 10:11:36 -05:00
Dan Williams
997ef39f88 wifi: rename set_current_ap -> set_active_ap
Matches the D-Bus property, less confusing.
2012-09-20 10:11:36 -05:00
Dan Williams
29fe6ec830 wifi: add SSID_NOT_FOUND reason and use it when we can
When the supplicant starts connecting, or gets disconnected, track
whether it ever starts talking to an AP.  Then if the connection fails
as a result of an initial connection timeout or a link timeout, we
can use SSID_NOT_FOUND when we're reasonably sure the AP doesn't
exist.  Clients can use this to show better error messages.

Note that SSID_NOT_FOUND may only be reported when using nl80211
drivers, as WEXT drivers don't provide the status necessary to
determine whether the network exists or not.
2012-09-20 10:11:36 -05:00
Dan Williams
30fe3e1876 wifi: only request new secrets during the initial connection
Don't automatically request new secrets just because previous
attempts to connect failed, since this could be due to many
other things than bad secrets.  Only request new secrets if
the caller of handle_auth_or_fail() specifically wants them.

Next, if the supplicant fails the initial association attempt
with an encrypted AP, only ask for new secrets if this is the
first time we're trying to connect to this network.  Otherwise
we assume the secrets good; if they aren't, the user should
change them through a configuration editor.

These changes should dramatically cut down the number of
unwanted secrets requests due to random driver failures, weak
AP signal strength, or out-of-range APs.
2012-09-20 10:11:36 -05:00
Dan Williams
85a7286f44 wifi: remove associated AP on failure
If the link to the current AP fails, that's either because it is out of range
or somebody turned it off, or the driver is being dumb.  Instead of leaving
the failed AP in the scan list, whereupon we'll just try reconnecting to it
again (even though it might not be visible), remove it from the list and
only try reconnecting if a new scan finds it.  To ensure that happens, start
a scan when entering the DISCONNECTED state, which the device enters
right after FAILED.

Now there's a race between the periodic update and the link timeout
handler, as the periodic update could have run right before the link
timeout, and if the card was momentarily unassociated when the periodic
update fired, priv->current_ap will be cleared, and thus we can't remove
it from the internal scan list.

To fix that, only run the periodic update when we know the supplicant is
talking to an AP.  When it's not talking to an AP the information that
the perioidic update gathers is meaningless anyway.  Plus, it's not very
helpful to clear the current AP just because the driver/supplicant are
in a transient state; if they recover the connection we've bounced
stuff unecessarily, and if they don't recover we'll be tearing the
connection down anyway.
2012-09-20 10:11:36 -05:00
Dan Williams
ccfe5fec8d wifi: don't autoconnect to networks that have never been successful
If you accidentally click on an wifi network in the menu, and you
don't know the password, and cancel, the connection always stuck
around and was available for autoconnection.  That's annoying, and
it's a few clicks to go delete them.  But better yet, we can
slightly repurpose the 'timestamp' property of connections to
determine whether or not they've been successfully connected in the
past; NM stores timestamps for all connections as of version 0.9.

So if a wifi connection hasn't ever been successful (which means it
has a timestamp in the timestamp cache, but that timestamp is zero),
don't try to autoconnect it.

Preloaded connections without a timestamp will still be autoconnected
at least once (as they always have) because they won't yet have a
timestamp in the timestamp cache.
2012-09-20 10:11:36 -05:00
Dan Williams
1966aba8e9 core: determine whether connection timestamps are set or not
Currently there's no way to differentiate between a connection that has
never been activated, and a connection that has never been *successfully*
activated.  In both cases nm_settings_connection_get_timestamp() returns
zero.  But it's useful to know whether a connection hasn't even been
tried yet, so enhance the timestamp code to return whether or not the
timestamp has been found in the timestamp cache or not, and make the
NMDevice core set an explict timestamp of 0 if the connection failed
on the first attempt.

We'll use this later to conditionally autoconnect WiFi connections
depending on whether they've ever successfully connected or not, but
still allow preloaded connections without a timestamp to autoconnect
as they always have.
2012-09-20 10:11:36 -05:00
Alexandre Rostovtsev
64342a313e core: wait until we daemonized before setting up signals (bgo #683932)
If we mask signals before daemonizing, the daemon process will not be
able to handle them, and thus would be unkillable with anything other
than SIGKILL.
2012-09-17 14:47:06 +02:00
Dan Williams
5ff70384e1 trivial: use define for supplicant interface state signal
Helps when you need to grep the code to change a signal's signature.
Otherwise you're stuck grepping for "state" which a lot of objects
have as a signal name.
2012-09-12 11:28:43 -05:00
Dan Williams
84a2910f47 trivial: whitespace fixup 2012-09-12 10:13:54 -05:00
Dan Williams
d42d41c1ac core: add cancelation to dispatcher calls 2012-09-11 17:17:58 -05:00
Dan Williams
15ca7cd56c core: add dispatcher callbacks and simplify dispatcher function prototypes
Remove unused args for the non-VPN cases to cut down on the NULL NULL NULL
stuff since we're also adding two more arguments.  Add the ability for
callers to give a callback that should be called when the dispatcher is
done.
2012-09-11 17:06:16 -05:00
Dan Williams
0201d6da87 core: convert dispatcher to asynchronous operation and return its results
In preparation for making NM wait on the dispatcher, make the dispatcher
call scripts asynchronously, and report the script results back to NM.
2012-09-11 17:06:16 -05:00
Dan Williams
cf255aa83b core: split dispatcher into its own file 2012-09-11 17:06:16 -05:00
Marius B. Kotsbak
c4a85acf80 core: add settings for 4G (LTE) network modes
NM_SETTING_GSM_NETWORK_TYPE_PREFER_4G and NM_SETTING_GSM_NETWORK_TYPE_4G added.
2012-09-11 11:47:22 -05:00
Jiří Klimeš
585564b9f5 dnsmasq: don't crash when there are no nameservers in IP config (rh #768531) 2012-09-06 11:40:52 +02:00
Jiří Klimeš
ddc3f727d0 core: fix a regression causing that driver and firmware versions are not set
Regression caused by 6ba93343e6
2012-09-03 16:18:54 +02:00
Dan Williams
2318b3c525 wired: ensure carrier changes clear queued state where appropriate
Buggy kernel drivers sometimes default the carrier to ON when they
are capable of link-detection but the carrier is actually off, and
they quickly switch the carrier OFF when they determine actual
carrier state (cdc-ether, for example).

The initial carrier ON event would trigger a queued state change
from UNAVAILABLE to DISCONNECTED, which may auto-activate the
device.  But before that state change happens, if a carrier OFF
event comes in, that queued state was not getting cleared and
the device would transition to DISCONNECTED even though the
carrier was off.

To ensure that never happens, and that we don't enter states that
aren't valid when the carrier is off, we need to clear any queued
state changes that wouldn't be valid in the new carrier state.
2012-08-30 16:04:13 -05:00
Dan Williams
46e0af2942 ip6: ignore cached/cloned routes when retrieving IPv6 config (lp:1038541) (bgo #671767)
Should also ignore them when building up the initial IPv6 config.
2012-08-30 16:04:13 -05:00
Ben Jencks
3ca3120e4a ip6: ignore cached/cloned route notifications from the kernel (lp:1038541) (bgo #671767)
The kernel periodically adds routes for specific operations, including
when pinging any host.  These are temporary routes and aren't part of
the interface's permanent routing configuration, so we should ignore
them.
2012-08-30 16:04:13 -05:00
Dan Williams
c8c7690bb4 bluetooth: predicate DUN availability on ModemManager availability
If ModemManager isn't running, don't put DUN connections into
AvailableConnections, and don't allow DUN connections to be started
either automatically or manually.
2012-08-29 17:39:33 -05:00
Dan Williams
e6061a1e96 api: add a "ModemManager unavailable" device state reason
To be used when MM quits unexpectedly, or isn't running and the
device needs MM.
2012-08-29 17:39:33 -05:00
Dan Williams
0111d4dbd7 modem: fix DNS configuration with static IP modems
The MM API defines the GetIP4Config method return as (uuuu) which
is [ IP, DNS1, DNS2, DNS3 ].  Unfortunately the for() loop in the
static_stage3_done() function started at index 0, which is the IP
address.  This caused the IP address to be added to the DNS list.
It should start at index 1 instead.
2012-08-28 19:58:22 -05:00
Dan Williams
ae544fe435 modem: log IPv4 configuration 2012-08-28 11:35:28 -05:00
Dan Winship
2062a98851 core: remove erroneous reference to VLAN-over-IPoIB 2012-08-27 13:27:35 -04:00
Dan Williams
9379a729f4 core: handle return values from libsystemd-login correctly
The functions return an 'int', which can be < 0 for errors, so
we can't just treat the return value as a boolean.
2012-08-27 09:55:04 -05:00
Dan Williams
052a24343e modem: track modem state and fail device if modem disconnects
This worked fine with PPP because PPP terminates, and NM watches
for that and handles it fine.  But modems with pseudo-ethernet ports
don't have anything like that, so we have to watch the modem's state
property instead.  This works only with MM 0.5.4 and later (including
0.6).
2012-08-24 13:24:16 -05:00
Dan Williams
722ce46aaa core: ignore PPP interface removal signals from udev
PPP interfaces are transient and created by their master interface
(usually for PPPoE or WWAN) and thus we don't want their removal
to affect their master device.  Unfortunately, that was happening
when a manual 'killall -TERM pppd' was run, which caused the
udev device removal signal, which caused NM to remove the master
WWAN device when udev signaled that the 'ppp' interface was gone.
2012-08-24 12:06:22 -05:00
Dan Williams
55542ffb3e vlan: fix missing chain up to parent dispose
Otherwise the parent classes (like NMDevice) don't clean up correctly.
2012-08-24 12:06:22 -05:00
Dan Williams
6ba93343e6 core: fix possible uninitialized memory usage 2012-08-24 12:06:22 -05:00
Jiří Klimeš
b39804ae6b trivial: use dashes in "br2684-bridge-failed" to match other reason strings 2012-08-22 13:40:46 +02:00
Dan Williams
ef4f6a2e55 rfkill: detect "acpi" subsystem devices as platform devices (bgo #680632)
Some rfkill drivers (sony-laptop, ideapad-laptop, classmate-laptop,
etc) register their rfkill drivers under the "acpi" subsystem instead
of the platform subsystem, but the semantics are the same.
2012-08-17 15:31:57 -05:00
Dan Williams
0065165901 rfkill: fix up grandparent driver name detection 2012-08-17 15:28:17 -05:00
Dan Williams
ee920262ac rfkill: better logging of platform switches and states 2012-08-17 15:27:58 -05:00
Dan Williams
3ba28d9b16 wifi: ensure hidden SSIDs get added to AvailableConnections
Hidden SSIDs won't always show up in the scan list, so they need
to be present in AvailableConnections even if we don't see them
int he scan list.
2012-08-16 13:16:42 -05:00
Dan Williams
e962f06253 keyfile: use friendly MAC address format for WiMAX 2012-08-15 16:51:59 -05:00
Nathanael D. Noblet
808136ac02 core: add AvailableConnections property for NMDevice objects
Implements a new property that provides a list of currently
available connections a device could connect to. For example
if a connection for a particular wireless connection exists and
that wireless network appears in the scan list it would show in the
AvailableConnections property of the device.

(dcbw: found a slightly cleaner way to do this; it's a lot like the
check_connection_compatible class method, except it deals with
live network data too.  So convert the subclass methods to
just check additional live network data, and have the base
device class handle adding the connection to the hash and all
the associated signalling.  Also fix a bug where the available
connections were not updated when a device moved from UNAVAILABLE
to available, its available connections were not updated)
2012-08-15 16:50:49 -05:00
Paul Menzel
b2d97cc96c ifnet: fix typo fut*u*re 2012-08-15 14:24:50 -05:00
Pavel Šimerda
3e0f1d9129 dns: remove broken bind plugin 2012-08-15 12:24:20 -05:00
Dan Williams
ad49bc7b8e wimax: add missing copyright header 2012-08-06 17:58:16 -05:00
Dan Williams
1d7949e66c build: fix up includes; prefer builddir over srcdir
WiMAX failed distcheck if the iwmxsdk devel files were installed but
--enable-wimax=no was used, since the distcheck configure bits found
the iwmxsdk headers, defaulted WiMAX support to 'on', and then proceeded
to use the generated headers from the top srcdir, where of course
wimax was turned off (due to --enable-wimax=no).  Instead, everything
should use the headers from the builddir, which reflects the options
that 'make distcheck' actually selects.

At the same time, re-order various includes everywhere to ensure that
the builddir paths come before the srcdir paths to prevent this from
happening in the future.
2012-08-06 17:27:17 -05:00