Commit Graph

7740 Commits

Author SHA1 Message Date
Jiří Klimeš
fdfbe00aac policy: remove "invalid mark" for failed connections after 5 mins
If there is a temporary connection failure (e.g. due to unavailable DHCP), the
connection is marked as invalid after several retries. Reset the flag after
5 mins to allow next auto-reconnection.
2011-06-23 11:45:16 +02:00
Dan Williams
a5850e82bc ifcfg-rh: fix distcheck after c2dbd1f836
IPV6_FAILURE_FATAL is now read and defaults to TRUE for ifcfg files
even if IPv6 is turned off.  That means that if we write a connection
for which NM_SETTING_IP6_CONFIG_MAY_FAIL is FALSE but IPv6 is disabled,
ifcfg-rh won't write out IPV6_FAILURE_FATAL (because IPv6 is disabled
so why bother writing out IPv6-related settings) but on re-read it will
treat the absence of IPV6_FAILURE_FATAL as TRUE/yes.  This leads to
a mismatch between the connection that was written out (which will
have NM_SETTING_IP6_CONFIG_MAY_FAIL=FALSE and no IPV6_FAILURE_FATAL)
and the re-read connection (which will have
NM_SETTING_IP6_CONFIG_MAY_FAIL=TRUE since a missing IPV6_FAILURE_FATAL
is treated as NM_SETTING_IP6_CONFIG_MAY_FAIL=TRUE).
2011-06-20 18:41:56 -05:00
Dan Williams
538cef0805 libnm-glib: fix make distcheck 2011-06-20 11:40:04 -05:00
Jorge González
69f76d3245 po: updated Spanish translation (bgo #651385) 2011-06-20 16:46:29 +02:00
Dan Williams
cfd6ba1690 libnm-glib: fix demarshalling of Dhcp6Config property changes
This bit apparently got forgotten in 10ea7a911c
2011-06-18 17:16:48 -05:00
Michal Schmidt
ffbb7df4b8 systemd: fix NetworkManager-wait-online.service to wait for link up (rh #710502)
Since commit 0ce4b6b412
NetworkManager-wait-online.service quits immediately if there is no link yet.
Fix it by removing the '-x' option.

But if we do just that, NM-w-o would add a useless 30 seconds delay in the
case when NM is not running at all.
Solve this by adding a Requisite= dependency on NM.

https://bugzilla.redhat.com/show_bug.cgi?id=710502
2011-06-17 14:02:39 +02:00
Jiří Klimeš
502548b6ca ifcfg-rh: fix IPV4_FAILURE_FATAL handling and memory leaks, when IPv4 is disabled 2011-06-16 12:30:38 +02:00
Jiří Klimeš
c2dbd1f836 ifcfg-rh: read some more IPv6-related values as well even if IPV6INIT=no
We need to read IPV6_FAILURE_FATAL and other values, even if IPv6 is disabled.
Else the variables would use default values, which may not be right. Then
switching between methods "Ignore" and "Automatic" in a GUI would change value of
IPV6_FAILURE_FATAL property, even if it's not touched explicitly.
2011-06-16 11:14:52 +02:00
Dan Williams
fb62f395ea vpn: fix handling of connections with only system secrets
The core problem was the nm_connection_need_secrets() call in
nm-agent-manager.c's get_start() function; for VPN settings this
always returns TRUE.  Thus if a VPN connection had only system
secrets, when the agent manager checked if additional secrets
were required, they would be, and agents would be asked for
secrets they didn't have and couldn't provide.  Thus the
connection would fail.  nm_connection_need_secrets() simply
can't know if VPN secrets are really required because it
doesn't know anything about the internal VPN private data;
only the plugin itself can tell us if secrets are required.

If the system secrets are sufficient we shouldn't be asking any
agents for secrets at all.  So implement a three-step secrets
path for VPN connections.  First we retrieve existing system
secrets, and ask the plugin if these are sufficient.  Second we
request both existing system secrets and existing agent secrets
and again ask the plugin if these are sufficient.  If both those
fail, we ask agents for new secrets.
2011-06-15 12:19:47 -05:00
Jiří Klimeš
2d4619421c cli: simplify find_device_for_connection() 2011-06-15 15:00:55 +02:00
Jiří Klimeš
8d43875cbe libnm-glib: add nm_client_get_device_by_iface() for NMClient 2011-06-15 14:58:04 +02:00
Jiří Klimeš
acc3025dfc core: socket() returns -1 on failure 2011-06-15 11:03:29 +02:00
Jiří Klimeš
17bc5867dc ifcfg-rh: socket() returns -1 on failure 2011-06-15 10:43:07 +02:00
Dan Williams
5075ffe324 todo: add notes about vpn async secrets requests 2011-06-14 17:22:49 -05:00
Jiří Klimeš
b4a72d1ad7 libnm-glib: fix crash for AddAndActivateConnection() D-Bus call (bgo #652512)
When a partial connection is passed to nm_client_add_and_activate_connection(),
but it doesn't contain any settings, nm_connection_to_hash() returns NULL and
there's a crash later on the NULL hash.
2011-06-14 19:39:23 +02:00
Jiří Klimeš
6fe22d99f0 ifcfg-rh: fix possible crash when route file creation fails 2011-06-14 17:15:51 +02:00
Jiří Klimeš
c32914fa3b libnm-util: remove unused D-Bus dbus_g_bus_get() call from test-secrets.c 2011-06-14 16:22:09 +02:00
Jiří Klimeš
80df1e3aca libnm-util: remove unused D-Bus dbus_g_bus_get() call from test-secrets.c 2011-06-14 16:17:05 +02:00
Jiří Klimeš
31f8b65931 libnm-util: remove unused D-Bus dbus_g_bus_get() call from test-setting-8021x.c 2011-06-14 16:14:40 +02:00
Jiří Klimeš
28b5809cbe libnm-util: remove unused D-Bus dbus_g_bus_get() call from test-settings-defaults.c 2011-06-14 16:10:40 +02:00
Jiří Klimeš
74954136dd supplicant: remove unused D-Bus dbus_g_bus_get() call from test-supplicant-config.c 2011-06-14 16:03:28 +02:00
Jiří Klimeš
e8b5e2910d dhcp: remove unused D-Bus dbus_g_bus_get() call from test-dhcp-options.c 2011-06-14 15:54:08 +02:00
Jiří Klimeš
9eaf31f49a policy: don't cache "(none)" hostname on startup (rh #706094) 2011-06-14 13:21:14 +02:00
Aleksander Morgado
19019a8e0b build: fix automake portability warnings 2011-06-13 10:38:52 -05:00
Aleksander Morgado
33e6997599 libnm-util: added missing U2600 GSM band enumeration 2011-06-13 10:38:32 -05:00
Dan Williams
5e3c51fa4e wifi/mesh: require WEXT 21 or later
Seriously, get a kernel more recent than 2007.  Really.
2011-06-08 17:09:14 -05:00
Jiří Klimeš
9549c70d94 core: fix auto-connect to hidden SSIDs (rh #707406)
Previously (in NM 0.8.x) most WiFi connection were from user settings service.
And the service updated 'seen-bssids' property when got connected.
But the settings service in 0.9 don't do that. That inhibits auto-connecting to
hidden networks. This commit takes care of updating 'seen-bssids'. However, we
don't want to write out the conection each time it's activated (touching /etc).
So, seen BSSIDs are kept separately from the connection in a look-aside file.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2011-06-08 14:51:27 -05:00
Jiří Klimeš
060e865ecd core: trivial whitespace fixes 2011-06-08 14:51:27 -05:00
Jiří Klimeš
096a1fcdc9 examples: add a Qt example for setting manual IPv4 addresses into a connection 2011-06-08 19:18:53 +02:00
Dan Williams
9cba854fa0 settings: ensure transient secrets are ignored when rereading connections (rh #703785)
When a connection changes on-disk, the in-memory copy of it may contain
transient secrets (agent-owned or not saved) that dont' get written out
to disk.  When comparing the on-disk copy to the in-memory copy make sure
transient secrets are ignored so that we don't re-read the on-disk copy
needlessly.
2011-06-07 18:39:18 -05:00
Dan Williams
864db9f9e8 libnm-util: add new compare flags for ignoring various types of secrets
It turns out we need a way to ignore transient (agent-owned or unsaved)
secrets during connection comparison.  For example, if the user is
connecting to a network where the password is not saved, other
changes could trigger a writeout of that connection to disk when
connecting, which would the connection back in due to inotify, and the
re-read connection would then no longer be recognized as the same as
the in-memory connection due to the transient secret which obviously
wasn't read in from disk.

Adding these compare flags allows the code to not bother writing the
connection out to disk when the only difference between the on-disk
and in-memory connections are secrets that shouldn't get written to
disk anyway.
2011-06-07 18:22:48 -05:00
Dan Williams
a2acfdd46b core: simplify device activation precheck
The FIXME is correct; comparing the whole connection is just dumb now
since all connections are owned by NM, so we can simply compare pointers
to figure out of the incoming activation request is using the same
connection as the current activation request.  Plus, this comparison
would fail entirely if the connection has transient/always-ask secrets.
2011-06-07 14:22:55 -05:00
Dan Williams
f1329b486f core: more BT device removed log message less noisy
Don't log when any BT device is removed, just log when a device
we actually care about is removed.
2011-06-07 11:08:13 -05:00
Dan Williams
31450324e4 todo: add notes about ethernet connection autodetection 2011-06-06 13:58:17 -05:00
Dan Williams
9012263600 todo: add notes about only connecting WiFi it was previously successful 2011-06-06 12:29:18 -05:00
Dan Williams
b25c24fe94 todo: update with latest ADSL status 2011-06-06 11:42:54 -05:00
Dan Williams
650c546748 core: add some logging for activation and disconnection
'vperic' had an interesting problem on IRC where every 10 minutes
the ethernet would change state from ACTIVATED -> DISCONNECTED with
a reason code of 0; the only thing I can find is that something was
telling NM to activate a connection periodically, becasue that appears
to be the only place that changes state to DISCONNECTED with a
reason code of 0.  No logging; no apparent carrier changes.

So log this condition just in case we run into it later.
2011-06-02 09:06:48 -05:00
Dan Williams
d2ae0bac82 keyfile: better handle cert/key files that don't exist (bgo #649807)
The keyfile code has to handle a few different formats of cert/key values,
and wasn't doing a good enough job of detecting plain paths as values.  By
default the writer will write out a plain path (ie, not prefixed with file://)
and the reader will handle that correctly, *unless* that file does not
exist, at which the reader assumed it was a byte array.  This caused the
read-in keyfile not to match the in-memory connection (since the in-memory
connection though the cert/key held a path, but the read-in one thought it
contained a blob) and this seems to eventually have triggered a write-out
with the new values (as a blob), which would then drop a .pem file into
system-connections/ containing the path that should have been in the
keyfile in the first place.

This all happened because we assumed that the given path for the cert or
key would actually be valid, which doesn't seem to be the case for a lot
of people.  Clearly these connections won't work (since the certificate or
key does not exist) but the keyfile plugin shouldn't be messing up the
connection's settings at the very least.

Fix that by handling the check of whether the cert/key data is a path or
not in a less restrictive manner and add some testcases to make sure that
everything works as we expect.
2011-06-01 16:51:47 -05:00
Dan Williams
0f37efd77b keyfile: write relative cert/key paths too
If the cert/key path is relative to the keyfile then don't
bother writing the absolute path out.  This also prevents the
keyfile plugin from rewriting a relative path to an absolute one,
preventing some annoyance for people that hand-edit keyfiles.
2011-06-01 16:51:47 -05:00
Dan Williams
06ec2a5382 keyfile: convert relative cert/key paths to absolute ones when reading
Passing a relative path to wpa_supplicant does no good since the supplicant
may not have the same working directory as NetworkManager.  Relative paths
used in keyfiles are assumed to be relative to the keyfile itself anyway,
so actually use the absolute path we compute for the cert/key instead of
leaving it relative.
2011-06-01 16:10:58 -05:00
Dan Williams
c1dd530798 keyfile: ignore .pem and .der file changes
Since the keyfile plugin only stores the paths of these files,
we don't really care about what's in them.  We also don't want
to attempt to read them as keyfiles, which produces warnings
in the logs.
2011-06-01 13:26:25 -05:00
Dan Williams
10ea7a911c libnm-glib: fix up empty object path demarshalling after 8afce8590a
G_VALUE_HOLDS will fail if the value variable is NULL, so we only
want to check that the GValue holds the right type if the value
is valid.  NULL means "no object path" in demarshallers.
2011-06-01 12:55:54 -05:00
Jiří Klimeš
a70d87d84e trivial: put all prototypes inside G_BEGIN_DECLS and G_END_DECLS 2011-05-31 14:06:13 +02:00
Jiří Klimeš
9aa7efcf28 core: reset auto retries counter when cable is replugged
When re-plugging we may be in a different network. So we should try the
compatible connections again.

Based on a patch from Mikhail Efremov.
2011-05-30 13:07:49 +02:00
Andreas Schwab
6780818974 cli: fix incorrect cast to time_t pointer 2011-05-30 12:13:34 +02:00
Dan Williams
57e7ccca6d release: bump version to 0.8.9997 (0.9-rc3) 2011-05-27 09:38:29 -05:00
Dan Williams
78ce088843 libnm-util: remove some left-over debugging code 2011-05-26 22:19:35 -05:00
Dan Williams
4a0c7d9dd4 test: use nm_device_get_active_connection() in nm-tool 2011-05-26 22:12:15 -05:00
Dan Williams
232bb3cea2 settings: suppress warnings about NULL hash tables 2011-05-26 19:43:19 -05:00
Dan Williams
0e7b71102b libnm-glib: add support for the "active-connection" device property 2011-05-26 19:39:12 -05:00