summaryrefslogtreecommitdiff
path: root/libnm-glib
AgeCommit message (Collapse)AuthorFilesLines
2013-11-18libnm-glib: fix crash by taking additional ref in nm-remote-connection/result_cbThomas Haller1-0/+2
result_cb invokes a function pointer provided by the user. Nothing prevents the user from destroying the NMRemoteConnection in the callback, which leads to a crash. Take an additional ref of NMRemoteConnection to keep it alive. This probably caused a crash for nm-applet: https://bugzilla.redhat.com/show_bug.cgi?id=1030403 Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-18libnm-glib: fix return value in nm_remote_settings_load_connections()Jiří Klimeš1-2/+2
when g_return_val_if_fail() fails.
2013-11-15libnm-glib: add nm_remote_settings_load_connections()Dan Winship3-0/+77
https://bugzilla.gnome.org/show_bug.cgi?id=709830
2013-11-14libnm-glib: fix a crash in NMObjectDan Winship1-0/+3
deferred_notify_cb() needs to take a ref on the object around emitting its deferred signals, since otherwise if a notify:: handler drops the last reference on an object, a following g_object_notify() call would crash.
2013-11-13coverity: fix various warnings detected with CoverityThomas Haller1-1/+6
These are (most likely) only warnings and not severe bugs. Some of these changes are mostly made to get a clean run of Coverity without any warnings. Error found by running Coverity scan https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Co-Authored-By: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-06libnm-glib: add NMDevice:physical-port-id propertyDan Winship3-0/+58
Add the physical-port-id property to NMDevice so that clients can recognize NPAR/SR-IOV devices.
2013-10-31libnm-glib: add support for NULL connections to nm_client_activate_connection()Dan Williams1-3/+7
Pass along to NetworkManager, which picks the best available connection for the device and activates it.
2013-10-22core: cleanup freeing of glib collections of pointersThomas Haller10-41/+23
When freeing one of the collections such as GArray, GPtrArray, GSList, etc. it is common that the items inside the connections must be freed/unrefed too. The previous code often iterated over the collection first with e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument. For one, this has the problem, that g_free has a different signature GDestroyNotify then the expected GFunc. Moreover, this can be simplified either by setting a clear function (g_ptr_array_set_clear_func) or by passing the destroy function to the free function (g_slist_free_full). Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-22libnm-glib: fix use proper unref function in libnm-glib/nm-ip4-config.cThomas Haller1-3/+3
NMIP4Address and NMIP4Route instances must be released with a special nm_ip4_*_unref function. Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-19Fix typosYuri Chornoivan3-3/+3
https://bugzilla.gnome.org/show_bug.cgi?id=710505
2013-10-15libnm-glib: remove bogus warningDan Williams1-1/+0
When connecting to a hidden SSID, the Access Point object that NetworkManager creates will have no frequency, because the frequency is unknown until the connection succeeds. The warning has no use; if the AP doesn't have a frequency then it even match a connection with a specified frequency.
2013-10-14trivial: whitespace fixThomas Haller1-17/+17
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-14libnm-glib: fix a crash in nm_client_new() (rh #1010288)Jiří Klimeš1-5/+30
We have to check if 'client' is valid when calling _nm_object_ensure_inited(). Creation of NMClient object can fail, because its parent NMObject's constructor() returns NULL for D-Bus errors. https://bugzilla.redhat.com/show_bug.cgi?id=1010288
2013-10-11libnm-util, libnm-glib: fix up some gtk-doc commentsDan Winship9-21/+23
gtk-doc recognizes that #NMFoos is the plural of #NMFoo now, so you don't need to put an empty comment between the type name and the "s" to make it work. (Unfortunately, it's not smart enough to realize that "NMIP4Addresses" is the plural of "NMIP4Address".) Also, add some missing "#"s noticed along the way.
2013-10-04test: launch dbus for test-remote-settings-clientThomas Haller1-1/+5
Running `make check` on systems without running dbus failed in test-remote-settings-client.c:383 make[4]: Entering directory `/tmp/NetworkManager/libnm-glib/tests' /tmp/NetworkManager/libnm-glib/tests/test-remote-settings-client /tmp/NetworkManager/libnm-glib/tests test-remote-settings-service.py ** (/tmp/NetworkManager/libnm-glib/tests/.libs/lt-test-remote-settings-client:26983): WARNING **: Error connecting to D-Bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 make[4]: *** [check-local] Trace/breakpoint trap (core dumped) Modify the Makefile to start the dbus-daemon, if it is not yet running. Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-03libnm: more valgrinding fixesDan Winship4-7/+17
2013-10-03libnm-glib: fix the leak that breaks the shell network status iconDan Winship1-7/+5
All NMObjects created in response to property changes were getting leaked, which in particular included all NMAccessPoint objects, which meant that after disconnecting and reconnecting a wifi interface some number of times (depending on how many access points were in the area), gnome-shell would be watching so many D-Bus AccessPoint objects (most of which didn't exist any more) that it would hit dbus-daemon's limit on the number of match rules you can register, which meant that NMActiveConnections created after that point wouldn't be able to register for PropertiesChanged notifications, which meant that the network status icon would get out of sync.
2013-10-02trivial: whitespace fixDan Williams1-0/+1
2013-10-01libnm-glib: make properties-changed debugging available at runtimeDan Williams1-14/+22
Use an environment variable LIBNM_GLIB_DEBUG=properties-changed to indicate that properties-changed debugging messages should be printed. Also cleans up the debug output formatting.
2013-09-27vpn: fix VPN plugin D-Bus errorsJiří Klimeš1-1/+1
The errors were documented as org.freedesktop.NetworkManager.VPN.Error.*, but the actual values were org.freedesktop.NetworkManager.VPN.Plugin.* Also update the errors documentation.
2013-09-27vpn: fix connecting to VPN (bgo #708255)Jiří Klimeš2-13/+18
The ConnectInteractive() -> Connect() fallback code doesn't work, because _connect_internal() changes the state to NM_VPN_SERVICE_STATE_STARTING before checking if it can implement ConnectInteractive(), and then when the Connect() call comes in, the VPN is not in STOPPED or INIT, so it returns an error. The commit moves setting state to STARTING after the ConnectInteractive() check availability, in the plugin. We introduce new plugin error and set it when the the plugin does not implement ConnectInteractive(). NetworkManager uses this error for ConnectInteractive() -> Connect() fallback. https://bugzilla.gnome.org/show_bug.cgi?id=708255
2013-09-26libnm-glib: fix cut+pasteoDan Winship1-2/+2
2013-09-25core: update existing IP[46]Config of device instead of replacing it (bgo ↵Thomas Haller4-34/+229
#707617) When the IP[46]Config changes, a new configuration gets assembled. Before, whenever the new configuration was different than the current one, the IP[46]Config of the device was completely replaced. This also meant, that the old dbus IP[46]Config object was removed and the new one was exported. Now instead of recreating a new configuration, it updates the existing (already exported) configuration in-place. Also, add new gobject properties 'gateway' and 'searches' to the config class, they will be exported over dbus. Also, whenever any of the exported properties changes, make sure that a notify signal gets emitted. https://bugzilla.gnome.org/show_bug.cgi?id=707617 Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25trivial: fixup whitespaceThomas Haller2-55/+55
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25libnm-util, libnm-glib: bump .so versions to be higher than 0.9.8.4'sDan Winship1-1/+1
2013-09-24infiniband: only check the last 8 bytes when doing hwaddr matchesDan Winship1-1/+3
IPoIB "hardware addresses" are only partly based on the hardware, and partly based on the InfiniBand configuration. So when checking if a configuration matches a device, we should only match the fixed part.
2013-09-14libnm-glib: fix NMDeviceModem connection compatible check for LTE connectionsDan Williams1-2/+6
The 3GPP checks didn't include LTE capabilities, so the modem connection_compatible check would fail for LTE connections with LTE compatible devices.
2013-09-12all: standardize on NMSettingWired:mac-address for all VLANsDan Winship2-0/+20
Currently, ethernet-based VLANs can specify the hardware address of the parent device (and, in theory, the cloned hardware address and MTU of the VLAN device) by using an NMSettingWired in addition to the NMSettingVlan. The theory was that non-ethernet-based VLANs, when we eventually supported them, would likewise use the setting type corresponding to their parent device. However, this turns out to be both complicated (the settings plugins and connection editor would have a hard-to-impossible time figuring out which setting type to use in some cases) and incorrect (for most L2 settings [eg, BSSID, bond mode, etc], the VLAN can't have its own values separate from the parent device). What we should have done was just have :mac-address, :cloned-mac-address, and :mtu properties on NMSettingVlan. However, at this point, for backward-compatibility, we will just stick with using a combination of NMSettingVlan and NMSettingWired, but we will use NMSettingWired regardless of the underlying hardware type.
2013-09-11libnm-glib: change "Since: 0.9.10" to "Since: 0.9.8.6" for backported APIDan Winship1-9/+9
2013-09-09libnm-glib: fix nm_remote_connection_delete() callbackDan Winship1-0/+13
If you called nm_remote_connection_delete() on a connection whose only ref was held by the NMRemoteSettings, then the callback would never get called, because NMRemoteSettings would drop its ref before then (when the connection emitted the 'removed' signal), so the callback would get cancelled. Fix this by taking an extra ref on the connection around the D-Bus call in this case. https://bugzilla.redhat.com/show_bug.cgi?id=997568 https://bugzilla.gnome.org/show_bug.cgi?id=706141
2013-09-05libnm-glib: don't warn when dbus object initialization fails with UNKNOWN_METHODThomas Haller1-2/+4
A common case where this warning was triggered, was the removal of IP6Config objects. As this can happen as a regular event, do not warn in this case. Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-08-28libnm-glib: Add NMClient:primary-connection and :activating-connectionDan Winship3-0/+106
https://bugzilla.gnome.org/show_bug.cgi?id=704841
2013-08-28libnm-glib: support new connectivity property/methodsDan Winship3-0/+230
2013-08-22build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happyDan Winship2-11/+10
Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS variables, which $(INCLUDES) did not, so this requires some additional changes. In most places, I have just gotten rid of the per-target _CPPFLAGS variables; in directories with a single target, the per-target variable is unnecessary, and in directories with multiple targets, the per-target variable is often undesirable, since it forces some files to be compiled twice, even though there ends up being no difference between the two files.
2013-08-19libnm-glib: add missing symbolGiovanni Campagna1-0/+1
The symbol is part of the public API (included in the GIR file), and gjs complains loudly if a defined symbol is not found. https://bugzilla.gnome.org/show_bug.cgi?id=706259 Acked-by: Pavel Šimerda <psimerda@redhat.com>
2013-08-16libnm-glib: add NMClient:startup, nm_client_get_startup()Dan Winship3-0/+46
Expose the new NMManager:startup property on NMClient.
2013-08-15libnm-glib: add support for team deviceJiri Pirko5-0/+430
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-08-03all: replace struct in_addr with guint32Pavel Šimerda1-3/+3
2013-07-31libnm-glib-vpn: add support for interactive secrets requestsDan Williams3-15/+184
There are three additions to the D-Bus interface for VPN plugins as part of this patch: 1) ConnectInteractive(): called by NM instead of Connect() to let the plugin know that it can request additional secrets during the connection process using SecretsRequired 2) SecretsRequired: a new signal emitted by the plugin to indicate to NetworkManager that additional secrets are required to connect; can only be called if NetworkManager initiated the connection by calling the ConnectInteractive() method 3) NewSecrets(): a new method of the plugin that NetworkManager calls when new secrets requested by the SecretsRequired signal have been retrieved from secret agents We need new methods because agents need to be aware of the hints that the VPN plugins may send with the SecretsRequired signal (detailing the specific secrets that are required) and at this time, not all agents support passing those hints to the VPN plugin authentication dialogs.
2013-07-31libnm-glib-vpn: consolidate connect handling codeDan Williams1-78/+40
2013-07-31libnm-glib: add support for agent capabilities during registrationDan Williams3-11/+90
Tries the new RegisterWithCapabilities method first, and falls back to the old Register method for compatibility with older NetworkManager.
2013-06-14core: add monitor-connection-files=false and ReloadConnectionsDan Winship3-0/+48
Add a "monitor-connection-files" config option, which can be set to "false" to disable automatic reloading of connections on file change. To go with this, add a new ReloadConnections method on o.fd.NM.Settings that can be used to manually reload connections, and add an nm-cli command to call it.
2013-06-11libnm-glib: fix device description with newer udev versionsDan Williams1-1/+5
At some point ID_MODEL_FROM_DATABASE became what we should look for; fixes device description not being constructed for many devices.
2013-06-08libnm-glib: fix the object creation warning for remote connectionsDan Winship1-1/+12
NMRemoteConnection is not a NMObject, so we can't always use nm_object_get_path(), https://bugzilla.gnome.org/show_bug.cgi?id=701762
2013-05-28libnm-glib: add support for new connection unsaved functionalityDan Williams6-62/+378
2013-05-15libnm-glib: fix documentation C&P errorDan Williams1-2/+1
2013-05-08libnm-glib, core: use g_cclosure_marshal_genericDan Winship8-36/+15
Since we depend on new glib now, we can just use the generic marshaller rather than generating our own.
2013-05-07libnm-glib: fix introspection for IPv6 DNS serversDan Williams1-3/+3
Posix apparently isn't a GObject Introspection module...
2013-05-07libnm-glib, cli: add nm_device_get_type_descriptionDan Winship5-1/+68
Add a new libnm-glib method to get the type description for a device, and use it in nmcli. For most types, the type description is based on the class name, but for NMDeviceGeneric, it comes from the :type-description property.
2013-05-07core: add NMDeviceGeneric:type-descriptionDan Winship2-0/+22
Use nm_platform_link_get_type_name() to get information about the generic device, and export that via D-Bus