Commit graph

6699 commits

Author SHA1 Message Date
Dan Winship
be18dd06cd libnm-glib: NULL out priv fields on dispose()
In some situations, objects might get used after being disposed, so
clear out their various priv fields so we don't try to access unreffed
objects, freed strings, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=674473
2012-04-23 16:09:58 -04:00
Dan Williams
411cb36344 libnm-glib: protect against potentially NULL changed property values (rh #808784)
No idea *why* they're NULL, unless perhaps that dbus-glib can't demarshal
the variants for some reason, but until we know why at least log the
problem so we know what properties the issue might affect.
2012-04-23 14:30:42 -05:00
Dan Williams
494f0a2e20 libnm-glib: ensure NMRemoteConnection signals are disconnected (bgo #674484) (lp:949743)
If a client keeps the connection around after NMRemoteSettings is done
with it (and has emitted 'removed' for that connection) then the
RemoteSettings object was still registered to receive signals for
that connection.  To prevent clients from being able to screw up
the RemoteSettings, disconnect any signals it may be listening for
when the connection is removed.  (it should be doing that anyway)
2012-04-23 13:40:43 -05:00
Dan Williams
614c46f87b trivial: fix spacing 2012-04-20 09:57:22 -05:00
Dan Winship
77de91e5a8 core: don't fight with the kernel over the default IPv6 route
The kernel wants there to be a default route over every RA-ed IPv6
interface, and it gets confused and annoyed if we remove that default
route and replace it with our own (causing it to effectively drop all
further RAs on the floor, which is particularly bad if some of the
information in the earlier RA had an expiration time).

So, rather than replacing the kernel's default route(s), just add an
additional one of our own, with a lower (ie, higher priority) metric.

https://bugzilla.redhat.com/show_bug.cgi?id=785772
2012-04-19 16:25:13 -04:00
Jiří Klimeš
217c5bf6ac core: improve handling of POSIX signals using sigwait() (rh #739836)
There are multiple ways how to handle standard unix signals. They work quite
well for a single-threaded application. However, signal handling in a multi-
threaded app becomes tricky. And, the most safe way is to use sigwait() function
in a dedicated thread, which allows us to process the signals synchronously and
thus avoid various nasty problems.

A few useful links:
http://pubs.opengroup.org/onlinepubs/007904975/functions/sigwait.html
http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.genprogc%2Fdoc%2Fgenprogc%2Fsignal_mgmt.htm
http://www.linuxjournal.com/article/2121?page=0,2
http://www.redwoodsoft.com/~dru/unixbook/book.chinaunix.net/special/ebook/addisonWesley/APUE2/0201433079/ch12lev1sec8.html
2012-04-17 15:29:10 +02:00
Jiří Klimeš
21bc3ab517 ifnet: do not call g_strv_length() on NULL 2012-04-12 13:45:58 +02:00
Mu Qiao
5f4d238baa ifnet: fix quote handling for global data (bgo #673548) 2012-04-12 13:45:31 +02:00
Mathieu Trudel-Lapierre
de3353d58c wifi: check the driver reports any encryption caps with nl80211 (bgo #673717)
Some drivers, such as ipw2200 doesn't report any encryption with newer kernels.
See also https://bugs.launchpad.net/ubuntu/+source/linux/+bug/973241
2012-04-12 12:21:01 +02:00
Dan Winship
8a2267ab6b Fix a few misc issues noticed by Coverity 2012-04-05 13:30:09 -04:00
Daniel Nylander
6a1208b526 po: updated Swedish translation (bgo #673234) 2012-04-03 15:47:43 +02:00
Kristjan SCHMIDT
ee04badfc2 po: updated Esperanto translation (bgo #673353) 2012-04-03 15:40:22 +02:00
Fran Diéguez
73c9112f27 po: updated Galician translation (bgo #672597) 2012-04-03 15:31:20 +02:00
Jiří Klimeš
fe3f010044 ifcfg-rh: clear MACADDR before writing it in wired setting (bgo #672646)
Else it's not possible to delete Cloned MAC (e.g. in the editor).
2012-04-03 14:57:31 +02:00
Jiří Klimeš
8bb2789444 libnm-glib: initialize GError, else invalid free() crash can occur (rh #809123) 2012-04-02 16:37:55 +02:00
Jiří Klimeš
75de2034c8 trivial: whitespace fixes 2012-04-02 13:08:19 +02:00
Jiří Klimeš
2b879e3a33 Revert "libnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh #806664)"
This reverts commit dd0460697c.

The commit dd0460697c make nm_remote_settings_new()
create the NMRemoteSettings object synchronously. It fixed getting properties,
but undid the previous ability to initialize the object asynchronously.
It can be reverted now, because a4f450aa0b commit
ensure initialization in get_property() calls.
2012-04-02 12:58:19 +02:00
Jiří Klimeš
47f9eb80d8 core: call is_adhoc_wpa() only after we check '802-11-wireless' setting
This prevents assertion while checking a connection that is not a wireless one.
2012-04-02 12:57:30 +02:00
Daniel Nylander
02482101ff po: updated Swedish translation (bgo #671096) 2012-03-30 13:17:11 +02:00
Matej Urbančič
71e5ad27f7 po: updated Slovenian translation (bgo #671775) 2012-03-30 13:09:57 +02:00
Jiří Klimeš
6b64e4db2f ppp: don't use struct ifpppstatsreq that was removed from linux/ip_ppp.h
in recent kernels.

We can use ifreq and ppp_stats structures separately. They needn't have to
to be packed in a structure.
2012-03-28 17:03:19 +02:00
Dan Winship
a4f450aa0b libnm-glib: more ensure_inited() fixing
We need to do _nm_object_ensure_inited() /
_nm_remote_settings_ensure_inited() from the get_property()
implementations; in most cases, get_property() just calls another
accessor method (which will call _nm_object_ensure_inited()), but in a
few places, it reads priv->whatever directly, so we need to make sure
that it's valid.
2012-03-28 09:06:12 -04:00
Jiří Klimeš
dd0460697c libnm-glib: initialize NMRemoteSettings in nm_remote_settings_new() (rh #806664)
The object was not initialized after creation in nm_remote_settings_new(). This
was a regression caused by 762df85234.
2012-03-27 22:36:55 +02:00
Jiří Klimeš
876f318ee8 ifupdown: add missing test18-wired-static-verify-ip6 to Makefile.am 2012-03-27 15:55:21 +02:00
Jiří Klimeš
b48dc05b72 libnm-glib: ensure bindings-created NMClient object work (rh #802536)
Most of the stuff was done by 762df85234.
But to allow this piece of code:

from gi.repository import NMClient
nmclient = NMClient.Client()
print nmclient.get_active_connections()

we also need to set "dbus-path" property in NMClient constuctor(),
else parent NMObject is not properly constructed.
2012-03-27 14:53:31 +02:00
Michael Biebl
546c269f8d Fix format string vulnerability in verify ()
which caused a build failure when compiling with -Werror=format-security
2012-03-24 23:07:56 +01:00
Dan Williams
54618a72e3 docs: fixups for new settings 2012-03-23 19:01:41 -05:00
Dan Williams
3f7f5e50de release: bump version to 0.9.4.0 2012-03-23 15:55:59 -05:00
Dan Williams
e9b110b29e libnm-glib: bump soname minor 2012-03-23 15:55:36 -05:00
Dan Williams
145b37d6ff libnm-util: bump soname minor 2012-03-23 15:55:21 -05:00
Dan Williams
f5f85f8a83 release: update NEWS 2012-03-23 15:11:02 -05:00
Dan Williams
8126947e08 settings: quiet warning when checking for AdHoc WPA connections 2012-03-23 09:59:20 -05:00
Dan Williams
085d822f28 core: suppress pointless log message when route already exists (lp:958519) 2012-03-22 16:22:48 -05:00
Dan Winship
a44effc1c7 TODO: remove bridging/bonding and InfiniBand
Bonding and InfiniBand are done. Bridging isn't, but after removing
the bonding and generic infrstructure parts of that section, there
wasn't really enough left to be worth keeping.
2012-03-22 15:50:43 -04:00
Dan Winship
49105f7115 core: do a better job of applying bond configuration
Reset all known bond options to their default values, not just the
ones that NMSettingBond allows overriding. Also, remove any bond
slaves that were already attached to the bond before we managed it.

Only update bond parameters that need to be updated. In particular,
setting either arp_interval or miimon to 0 has the side effect of also
setting the other one to 0, so don't do that if it's already 0.

Fix the handling of arp_ip_target; the sysfs arp_ip_target node does
not work the same way as the ifcfg BONDING_OPTS line (which is what
the code was assuming before).
2012-03-22 13:12:57 -04:00
Dan Winship
c4994bba54 libnm-util: improve NMSettingBond:verify()
Add NM_SETTING_BOND_ERROR_INVALID_OPTION and
NM_SETTING_BOND_ERROR_MISSING_OPTION error codes so we can better
distinguish errors in different options, and add checks for various
incompatible sets of options.
2012-03-22 13:12:57 -04:00
Dan Winship
131b434054 libnm-util: fix an NMSettingBond bug
NMSettingBond sets the "miimon" option to "100" by default, but this
means that when reading in a saved configuration with "arp_interval"
set, it would end up with both "miimon" and "arp_interval" set, which
is invalid. Fix this by clearing "miimon" if "arp_interval" is set,
and vice versa.
2012-03-22 13:12:57 -04:00
Dan Winship
4ad810fdf4 core: fix NMDeviceBond:dispose() to chain up 2012-03-22 13:12:57 -04:00
Dan Williams
925119074d wifi: work around more wl.o stupidity
Sometimes returns 0 for the current frequency when the radio is
active.  WTF?
2012-03-22 11:50:11 -05:00
Dan Williams
71ad568cfb ip6: fix setting default route with libnl3 (bgo #668286)
libnl3 wants a destination address when setting a route, so just hand
it '::' with a address len of 0 so we don't get -NLE_MISSING_ATTR
when trying to set the IPv6 default route.
2012-03-22 09:21:38 -05:00
Dan Williams
1ecc9c215c trivial: formatting fixes 2012-03-21 22:58:00 -05:00
Dan Williams
2290a70385 firewall: set interface zone before IP configuration (rh #805405)
We need to set the interface's firewall zone before we kick off
any sort of IP configuration, so that rules for stuff like
DHCP are already handled by the time that these services are started.
2012-03-21 15:10:11 -05:00
Dan Williams
762df85234 libnm-glib: ensure bindings-created objects work as expected (rh #802536)
Bindings (like GObject Introspection) almost always create objects
using g_object_new() by default and don't use our helper functions
like nm_client_new().  Thus we need to make sure that if the
object is created in that way, any property accesses or functions
that return properties ensure that the object is fully initialized,
which is what the _new() functions were supposed to do.  In one
case in NMClient that was missing (getting active connections)
and wasn't happening at all in NMRemoteSettings, which are our two
entry points into libnm-glib.

This allows this python+GI sequence to return the expected active
connection list:

from gi.repository import NMClient
nmclient = NMClient.Client(dbus_path='/org/freedesktop/NetworkManager')
active = nmclient.get_active_connections()
print(active)

where previously it returned an empty list because the NMClient
wasn't fully initialized by the time nm_client_get_active_connections()
was called.
2012-03-21 12:37:39 -05:00
Dan Williams
43f449824a mobile: ensure IPv4 timeout fails activation
With the switch to IPv4 being allowed to fail by default we need
to clean up this old code a bit.  PPP failure during IP config
should trigger a timeout, and the core code will handle whether
to fail the device completely or not.  But if we got a valid IPv4
config and PPP failed later, the device gets failed.  Previously
the device would just sit in IP_CONFIG state because now IPv4
defaults may-fail to TRUE, and when PPP failed the
nm_device_ip_config_should_fail() check would obviously not pass.
2012-03-20 23:21:17 -05:00
Jiří Klimeš
5238aa4107 utils: override VPN plugin's never-default when ignoring auto routes (rh #804563)
Setting never-default ito TRUE when VPN server provides routes was done
in https://bugzilla.gnome.org/show_bug.cgi?id=621698
2012-03-20 17:17:49 +01:00
Dan Williams
ce6b667a68 wifi: make sure we're connected to netlink before using it
This should fix the warning "failed to allocate link cache" when a
new device is added.  It doesn't affect WiFi operation, and the
code would fall back to non-nl80211 mechanisms of detecting whether
a device was wifi or not, so it corrects this check and quiets the
error message.
2012-03-19 16:09:46 -05:00
Dan Williams
1da9738f1b libnm-glib: add 'registered' property for NMSecretAgent
So clients can track when the agent is actually registered and when
it's registration state changes.
2012-03-19 13:24:28 -05:00
Dan Williams
4f0ddb105a release: bump version to 0.9.3.997 (0.9.4-rc1) 2012-03-19 10:11:33 -05:00
Mathieu Trudel-Lapierre
1a531b7ecf keyfile: fix testcases after InfiniBand transport-mode default change 2012-03-19 10:10:36 -05:00
Dan Williams
69247a00ea wifi: disable Ad-Hoc WPA connections (lp:905748)
The kernel is broken for Ad-Hoc WPA, and creates the connections
as open connections instead.  Yeah, eventually we can use
wpa_supplicant with RSN support, but for now we just have to
disable Ad-Hoc WPA because it's a problem to say we're creating
a protected network but then have the kernel not do that for
us.  Will be re-enabled once all the necessary bits have been
fixed.

Note that Ad-Hoc WPA has been broken since at least 2.6.32 with
mac80211-based drivers, which is what most users will be using.
2012-03-16 17:58:23 -05:00