Commit graph

6633 commits

Author SHA1 Message Date
Jiří Klimeš
366ac3c5a2 cli: use nm_device_connection_valid() function from libnm-glib
to verify whether device and connection match and don't duplicate the code
in nmcli.
2012-03-14 14:49:44 +01:00
Dan Williams
cfa1536fa8 ifcfg-rh: fix distcheck 2012-03-13 14:50:36 -05:00
Dan Williams
8e503afeda libnm-glib: two object uniqueness fixes
First: object creation requests get triggered each time a property
that refers to the object is read.  That can happen from a couple
of places around the same time (like initialization) and to be
expected.  But when those requests are processed (after we've
determined the type of object to create) a previous request may
have already created the object.  If that's the case don't create
a duplicate.

Second: properties can also be updated from a few places which
don't know about each other (from both regular code and the
"pseudo property" signal handlers) so when adding objects to
array properties, make sure the object hasn't already been
added to that array.
2012-03-13 14:31:26 -05:00
Jiří Klimeš
bb6da998b2 libnm-util: do not assert on buggy drivers with no WEP cipher capabilities
The crash happens with ipw2200, kernel 3.2.0 when a user tries to connect
to a hidden network using nm-applet.
g_assert (have_ap); is hit in 'case NMU_SEC_STATIC_WEP:' branch.

Reported by Mathieu Trudel-Lapierre.
See also:
(lp:908516)
(lp:908380)
2012-03-13 15:37:11 +01:00
Jiří Klimeš
19ffe0783f trivial: fix InfiniBand typo 2012-03-13 12:37:09 +01:00
Jiří Klimeš
a0b658281f ifnet: use nm_connection_get_setting_connection() to get 'connection' setting 2012-03-13 12:23:40 +01:00
Dan Williams
1138f136f8 libnm-glib: fix leaked NMDevice objects due to circular refcounting
Active Device objects held a reference to their ActiveConnection
which also held a reference  back to the Device.  Ensure that's
broken so everyone can get disposed correctly.
2012-03-12 19:26:34 -05:00
Dan Williams
64edbeb322 libnm-glib: ensure nm_device_set_device_type() stays private
Internal only function and should not be exported.
2012-03-12 14:33:51 -05:00
Dan Williams
4a370a9fa5 libnm-glib: prevent possible access of freed memory
valgrind reported that 'path' is already freed by the time we get
to _nm_object_cache_remove_by_path().
2012-03-12 14:33:17 -05:00
Dan Winship
54ef8f3224 Fix names of error enum values
When NM was registering all of its enum types by hand, it was using
NamesLikeThis rather than the default names-like-this for the "nick"
values. When we switched to using glib-mkenums, this resulted in
dbus-glib using different strings for the D-Bus error names, causing
compatibility problems.

Fix this by using glib-mkenums annotations to manually fix all the
enum values back to what they were before. (This can't be done in a
more automated way, because the old names aren't 100% consistent. Eg,
"UNKNOWN" frequently becomes "UnknownError" rather than just
"Unknown".)
2012-03-12 15:29:52 -04:00
Matej Urbančič
2a1277f0da po: updated Slovenian translation (bgo #671242) 2012-03-09 17:41:00 -06:00
Dan Williams
8a6d2aa7e9 trivial: fix completed VLAN connection name
VLAN is an acronym and thus should be capitalized.
2012-03-09 17:39:58 -06:00
Dan Williams
c113bf222a cli: fix VLAN priority map listing 2012-03-09 14:56:11 -06:00
Mu Qiao
e7380561d5 ifnet: remove system prefix
As all connections are system connection so the prefix is meaningless.
Drop it now.
2012-03-09 12:46:49 -06:00
Mu Qiao
e3a1b6e065 ifnet: ignore per-user connections
Ifnet currently does not deal with user agent service. Any connection
that comes with flagged secrets or is not system connection will be
ignored by the plugin. Thanks to David Narvaez for his great help on
this problem.
2012-03-09 12:45:25 -06:00
Dan Williams
d2c3a32e18 mandriva: add DefaultStop levels to initscript (bgo #669872)
Reported by Olav Vitters
2012-03-09 12:43:35 -06:00
Dan Williams
7f717f905b build: make VLAN code compatible with older kernels
Apparently VLAN_FLAG_LOOSE_BINDING isn't in older kernels like 2.6.32.
2012-03-09 12:20:42 -06:00
Dan Williams
6f19e1e18c wifi: fix typo in wifi detection code (bgo #671276)
Would affect non-nl80211 drivers since all nl80211 drivers have the
phyX link in sysfs and thus this code wouldn't get run for them.

Found by Dmitri <mitya@mageia.org>
2012-03-09 11:10:32 -06:00
Dan Williams
bba834f842 wifi: fix entering possible endless loop
Clarify how we're supposed to break out of the nl_recvmsgs() loop
and also break out if we get an error from nl_recvmsgs().  What's
supposed to happen is that one of the callbacks we've registered
figures out that we're done and sets the 'done' flag, which then
breaks out of the recvmsgs() loop.  Using 'err' there previously
was pretty unclear.
2012-03-08 12:48:46 -06:00
Dan Williams
25e011b5cf Revert "wifi: fix entering an endless loop"
This reverts commit 84403ab84a.

It appears we want to loop until one of the callback says we're
done, while this patch would exit too early (possibly before we'd
received a reply) since nl_recvmsgs() returns 0 on success.  What
we really want do do here is wait for one of the callbacks we've
registered to tell us that they've successfully handled the message
and gotten a reply.
2012-03-08 12:41:15 -06:00
Dan Williams
5a7fdd4b88 libnm-glib: simplify setting device-type property
Instead of having the superclass check the GObject type
and translate that into an NMDeviceType, have each subclass
set its own device type.
2012-03-07 12:22:37 -06:00
Dan Williams
bc50a2a75b cli: add VLAN device support 2012-03-07 11:45:40 -06:00
Dan Williams
c02702e574 libnm-glib: add NMDeviceVlan
And fix a small bug with bond devices too if their device type
isnt' set at construction time.
2012-03-07 11:45:25 -06:00
Dan Williams
dc6341acec vlan: try harder to get carrier state at device creation time
The carrier signal might be delayed a bit, so if we're creating
the device as a result of activating a connection, make sure the
carrier is up-to-date so we can proceed with activation.
2012-03-07 10:15:30 -06:00
Jiří Klimeš
84403ab84a wifi: fix entering an endless loop 2012-03-07 15:31:19 +01:00
Jiří Klimeš
79757f10f3 ifcfg-rh: use single quotes when quoting WPA passphrases (WPA_PSK) (rh #798102)
Single quotes ensure we don't break initscripts (bash processing) when the
string contains special characters. Special handling is necessary for single
quotes characters. They have to be escaped and the whole string has to be
prepended with '$' character so that bash is happy.
This change also filters out CR and LF characters as they break WPA_PSK
variable and could pose security issues.
2012-03-07 14:45:37 +01:00
Dan Winship
49214066a4 Fix capitalization of "InfiniBand"
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.

In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Dan Williams
4fc8b8ccd0 cli: don't require a device for virtual connections
They may not have had their devices created yet, and the activation
process creates the device, so allow NULL device paths for
activation.
2012-03-06 12:01:49 -06:00
Dan Williams
11da5fb6bc core: handle NULL device path for activation
For virtual interfaces and other cases we won't necessarily have
a device path, which means clients will be passing "/" instead.
Fix that up the same way we fix up the specific object.
2012-03-06 12:00:41 -06:00
Dan Williams
3567e6f9ea core: remove some redundant code and add some argument checks
ifindex is already passed to the function, no need to look it
up again.
2012-03-06 11:38:03 -06:00
Dan Williams
cd2c721762 core: use a second startup pass to detect all VLAN interfaces
We can't guarantee the ordering of devices that udev sends to us
on startup.  Thus, a VLAN interface could be sent before its
parent is, and we won't be able to find the parent in the device
list.  But that's fine; all parents will be detected during the
first pass, and we silently fail the VLAN interface.  Then we
do a second pass where any remaining VLAN interfaces will be
created because we found the parents during the first pass.
2012-03-06 11:07:15 -06:00
Dan Williams
8c3ac9bdd8 trivial: s/master/parent for VLAN interface info function 2012-03-06 11:07:15 -06:00
Jiří Klimeš
96a2bc43af cli: add a new reason code -> string mapping 2012-03-06 11:39:11 +01:00
Jiří Klimeš
78f09078f1 cli: add Bond device support 2012-03-06 11:31:03 +01:00
Dan Williams
723bab41ea ifcfg-rh: remove duplicate tests 2012-03-06 00:36:55 -06:00
Dan Williams
0d2aac2021 wifi: remove unused nl80211 attributes that break build on older kernels 2012-03-06 00:38:57 -06:00
Dan Williams
9296fd1ad0 docs: add Infiniband, VLAN, and Bond settings to API specs 2012-03-06 00:38:38 -06:00
Dan Winship
51f2bd0198 ifcfg-rh: don't write out a fake minimal IP4 config for bond slaves
The writer had code to fake up a simple IP4 config if the connection
didn't already have one. Make sure we don't do that in the bond case.
2012-03-05 15:55:43 -05:00
Dan Winship
6c38f0cfd1 libnm-glib: add NMDeviceBond
it exists on the server/D-Bus side, so it should exist in libnm-glib too
2012-03-05 15:55:43 -05:00
Dan Williams
a6809b0253 ip6: set binary NL address prefix too
There's both nl_addr_set_prefixlen() to set the binary address's
prefix length and rtnl_addr_set_prefixlen() to set the container
RTNL address's prefix length.  When the addresses come in from
the kernel these are the same, but when sending addresses to
the kernel, NM wasn't setting them to the same thing.  Do that,
since apparently libnl wants that when matching addresses in
nm-system.c:sync_addresses() here:

	if (addrs[i] && nl_object_identical (match, (struct nl_object *) addrs[i]))
		break;

otherwise the kernel addres (match) doesn't match the NM-derived
address (addrs[i]) that we got from the IP6Manager when reading
back kernel IPv6 addresses in response to netlink events.
2012-03-05 10:28:18 -06:00
Dan Williams
a9c3fe021a ip6: print out prefix in some debug messages 2012-03-05 10:28:17 -06:00
Jiří Klimeš
74d962e8c4 trivial: spacing fix 2012-03-05 13:19:47 +01:00
Jiří Klimeš
5519ff9952 cli: add 'vlan' setting 2012-03-05 09:52:10 +01:00
Jiří Klimeš
71e7434d1a cli: add 'bond' setting 2012-03-05 09:52:03 +01:00
Dan Williams
5cd9b1e22f wifi: don't remove APs still known to the supplicant
Because the supplicant doesn't have a BSS property for "last seen"
we have to fake that by listening to PropertiesChanged events for
stuff like signal strength, which usually changes a bit from scan
to scan.  But in case it doesn't change, we'll never get that PC
signal, and thus we'll never update our internal 'last seen'
timestamp, and thus the AP will get removed from the NM scan list
even if it was in the supplicant's last scan results.

So, if the AP if we haven't receieved a BssRemoved signal for the
AP yet don't remove it from the NM scan list.  One caveat is that
if the supplicant's DEFAULT_BSS_EXPIRATION_AGE value is greater
than NM's AP expiration age, NM will by consequence use the
supplicant's value instead.  At the moment the supplicant sets
DEFAULT_BSS_EXPIRATION_AGE to 180 seconds while NM's is 360.
2012-03-02 18:17:34 -06:00
Dan Winship
fb06cda723 libnm-util: fix two bugs in nm_setting_bond_get_option()
The function documents that it returns FALSE if idx is out of range,
so don't g_return_val_if_fail() in that case.

Also, free the return value from g_hash_table_get_keys().
2012-03-02 14:20:55 -05:00
Jiří Klimeš
501a389a19 cli: enable OLPC device now that we have it in libnm-glib 2012-03-02 09:02:33 +01:00
Jiří Klimeš
960621c400 vlan: add missing includes 2012-03-02 08:56:46 +01:00
Dan Williams
3efd156f50 release: bump version to 0.9.3.995 (0.9.4-beta1) 2012-03-01 18:05:28 -06:00
Dan Williams
e0613ac67c release: update NEWS 2012-03-01 18:02:13 -06:00