Commit Graph

7740 Commits

Author SHA1 Message Date
Jiří Klimeš
4ee617ddf2 libnm-util: add "secondaries" property containing secondary connection UUIDs
These connections are to be activated with the base connection.
2012-09-21 13:46:54 +02:00
Jiří Klimeš
004ea8166a cli: add NM_DEVICE_STATE_REASON_SSID_NOT_FOUND reason-to-string mapping 2012-09-21 10:04:28 +02:00
Dan Williams
aaa5d2f70f examples: add dispatcher example for exclusive wired/wifi 2012-09-20 10:19:11 -05: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
Dan Winship
4f809291bc build: update .gitignore 2012-09-19 10:33:11 -04: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
Sandeep Shedmake
866218b415 po: updated Marathi translation (bgo #683928) 2012-09-13 14:05:37 +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
Mick Boldon
d8b2e8c64a cli: fix "etc." typo (bgo #681173)
https://bugzilla.gnome.org/show_bug.cgi?id=681173
2012-09-10 13:09:09 +02: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š
bafd97b087 cli: add missing properties of 'connection' setting
zone
master
slave-type
2012-09-05 16:14:37 +02:00
Sandeep Shedmake
ace2980138 po: updated Marathi translation (bgo #682759) 2012-09-04 11:54:15 +02:00
Milo Casagrande
eb76c4f5ba po: updated Italian translation (bgo #682568) 2012-09-04 11:48:55 +02:00
Aurimas Černius
bac1b55a06 po: updated Lithuanian translation (bgo #682691) 2012-09-04 11:41:39 +02:00
Andika Triwidada
1f6ba6ff89 po: updated Indonesian translation (bgo #683026) 2012-09-04 10:53:22 +02:00
Yuri Chornoivan
b8d60ed36a po: updated Ukrainian translation (bgo #681621) 2012-09-04 10:43:34 +02:00
Tom Tryfonidis
bd135f3ba3 po: updated Greek translation (bgo #680818) 2012-09-04 10:37:11 +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
Jiří Klimeš
ef4b0f1d77 examples: add a shell example listing active Wi-Fi networks on Wi-Fi devices 2012-09-03 11:57:49 +02:00
Jiří Klimeš
02478a807d examples: add a shell example for disconnecting devices 2012-08-31 14:24:44 +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
Jiří Klimeš
c4bb7f26a8 cli: add NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE reason-to-string mapping 2012-08-30 14:14:27 +02:00
Dan Williams
81ff3b0f44 libnm-util: minor cleanups for nm_utils_iface_valid_name() 2012-08-29 17:55:03 -05:00
Thomas Graf
b46508b5c6 libnm-util: move dev_valid_name() to libnm-util and make it public
The bridging code needs it as well.
2012-08-29 17:46:54 -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 Winship
1eaf919bc6 libnm-glib: update properties before NMDevice:state-changed
Because object-valued properties (like ip4-config) get reloaded
asynchronously when they change, we will still have out-of-date values
for them cached at the point when we get the StateChanged signal from
the daemon. Work around this by manually reloading all properties
before emitting the client-side signal.

Also, fix a dumb bug in NMObject...
2012-08-29 15:46:15 -04:00
Jiří Klimeš
de763a42ec cli: put indexes into [] for AP and NSP in 'nmcli dev list' output
AP1 -> AP[1]
NSP1 -> NSP[1]
It's more readable (section names are AP an NSP) and it makes indexing
format conform to other data, like IP4.DNS[1].
2012-08-29 10:39:09 +02:00
Jiří Klimeš
9d3fd87dd2 examples: port update-secrets example to NM 0.9 API 2012-08-29 10:13:06 +02: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 Williams
4e80077cfa libnm-util: handle RSN IBSS in AP/connection compatibility checks 2012-08-27 16:56:57 -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