mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 15:28:03 +02:00
2008-03-25 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-ip4-config.c libnm-glib/nm-active-connection.c libnm-glib/nm-access-point.c - Use nm_object_queue_notify() instead of g_object_notify() * libnm-glib/nm-device.c - (demarshal_ip4_config): distinguish between successful but missing ip4-config request, and unsuccessful and missing ip4-config request - (nm_device_get_ip4_config): don't try to demarshal a NULL ip4-config path - Use nm_object_queue_notify() instead of g_object_notify() * libnm-glib/nm-device-802-11-wireless.c - (demarshal_active_ap): distinguish between successfull but missing active-ap request, and unsuccessful and missing active-ap request - (dispose, clean_up_aps): consolidate AP list and active AP clearing code - (nm_device_802_11_wireless_set_wireless_enabled): add a private hook for the NMClient to notify the device that wireless is disabled, and therefore to clear the AP list and active AP - Use nm_object_queue_notify() instead of g_object_notify() * libnm-glib/nm-client.c - (poke_wireless_devices_with_rf_status): new function - (update_wireless_status): notify wireless devices of the rfkill status so they can clean up if needed - Use nm_object_queue_notify() instead of g_object_notify() git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3502 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
9a163be59a
commit
56010ad03a
7 changed files with 170 additions and 47 deletions
30
ChangeLog
30
ChangeLog
|
|
@ -1,3 +1,33 @@
|
||||||
|
2008-03-25 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* libnm-glib/nm-ip4-config.c
|
||||||
|
libnm-glib/nm-active-connection.c
|
||||||
|
libnm-glib/nm-access-point.c
|
||||||
|
- Use nm_object_queue_notify() instead of g_object_notify()
|
||||||
|
|
||||||
|
* libnm-glib/nm-device.c
|
||||||
|
- (demarshal_ip4_config): distinguish between successful but missing
|
||||||
|
ip4-config request, and unsuccessful and missing ip4-config request
|
||||||
|
- (nm_device_get_ip4_config): don't try to demarshal a NULL ip4-config
|
||||||
|
path
|
||||||
|
- Use nm_object_queue_notify() instead of g_object_notify()
|
||||||
|
|
||||||
|
* libnm-glib/nm-device-802-11-wireless.c
|
||||||
|
- (demarshal_active_ap): distinguish between successfull but missing
|
||||||
|
active-ap request, and unsuccessful and missing active-ap request
|
||||||
|
- (dispose, clean_up_aps): consolidate AP list and active AP clearing
|
||||||
|
code
|
||||||
|
- (nm_device_802_11_wireless_set_wireless_enabled): add a private hook
|
||||||
|
for the NMClient to notify the device that wireless is disabled,
|
||||||
|
and therefore to clear the AP list and active AP
|
||||||
|
- Use nm_object_queue_notify() instead of g_object_notify()
|
||||||
|
|
||||||
|
* libnm-glib/nm-client.c
|
||||||
|
- (poke_wireless_devices_with_rf_status): new function
|
||||||
|
- (update_wireless_status): notify wireless devices of the rfkill status
|
||||||
|
so they can clean up if needed
|
||||||
|
- Use nm_object_queue_notify() instead of g_object_notify()
|
||||||
|
|
||||||
2008-03-25 Dan Williams <dcbw@redhat.com>
|
2008-03-25 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* libnm-glib/nm-object.c
|
* libnm-glib/nm-object.c
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ demarshal_ssid (NMObject *object, GParamSpec *pspec, GValue *value, gpointer fie
|
||||||
if (!nm_ssid_demarshal (value, (GByteArray **) field))
|
if (!nm_ssid_demarshal (value, (GByteArray **) field))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_ACCESS_POINT_SSID);
|
nm_object_queue_notify (object, NM_ACCESS_POINT_SSID);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ demarshal_devices (NMObject *object, GParamSpec *pspec, GValue *value, gpointer
|
||||||
if (!nm_object_array_demarshal (value, (GPtrArray **) field, connection, nm_device_new))
|
if (!nm_object_array_demarshal (value, (GPtrArray **) field, connection, nm_device_new))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_ACTIVE_CONNECTION_DEVICES);
|
nm_object_queue_notify (object, NM_ACTIVE_CONNECTION_DEVICES);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
#include "nm-client-bindings.h"
|
#include "nm-client-bindings.h"
|
||||||
|
|
||||||
|
void nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device, gboolean enabled);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMClient, nm_client, NM_TYPE_OBJECT)
|
G_DEFINE_TYPE (NMClient, nm_client, NM_TYPE_OBJECT)
|
||||||
|
|
||||||
#define NM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CLIENT, NMClientPrivate))
|
#define NM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CLIENT, NMClientPrivate))
|
||||||
|
|
@ -74,28 +77,58 @@ nm_client_init (NMClient *client)
|
||||||
priv->state = NM_STATE_UNKNOWN;
|
priv->state = NM_STATE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
poke_wireless_devices_with_rf_status (NMClient *client)
|
||||||
|
{
|
||||||
|
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; priv->devices && (i < priv->devices->len); i++) {
|
||||||
|
NMDevice *device = g_ptr_array_index (priv->devices, i);
|
||||||
|
|
||||||
|
if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
||||||
|
nm_device_802_11_wireless_set_wireless_enabled (NM_DEVICE_802_11_WIRELESS (device), priv->wireless_enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_wireless_status (NMClient *client, gboolean notify)
|
update_wireless_status (NMClient *client, gboolean notify)
|
||||||
{
|
{
|
||||||
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
|
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
|
||||||
gboolean val;
|
gboolean val;
|
||||||
|
gboolean poke = FALSE;
|
||||||
|
|
||||||
val = nm_object_get_boolean_property (NM_OBJECT (client),
|
val = nm_object_get_boolean_property (NM_OBJECT (client),
|
||||||
NM_DBUS_INTERFACE,
|
NM_DBUS_INTERFACE,
|
||||||
"WirelessHardwareEnabled");
|
"WirelessHardwareEnabled");
|
||||||
if (val != priv->wireless_hw_enabled) {
|
if (val != priv->wireless_hw_enabled) {
|
||||||
priv->wireless_hw_enabled = val;
|
priv->wireless_hw_enabled = val;
|
||||||
g_object_notify (G_OBJECT (client), NM_CLIENT_WIRELESS_HARDWARE_ENABLED);
|
poke = TRUE;
|
||||||
|
if (notify)
|
||||||
|
nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WIRELESS_HARDWARE_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
val = priv->wireless_hw_enabled ? TRUE :
|
if (priv->wireless_hw_enabled == FALSE)
|
||||||
nm_object_get_boolean_property (NM_OBJECT (client),
|
val = FALSE;
|
||||||
NM_DBUS_INTERFACE,
|
else
|
||||||
"WirelessEnabled");
|
val = nm_object_get_boolean_property (NM_OBJECT (client),
|
||||||
|
NM_DBUS_INTERFACE,
|
||||||
|
"WirelessEnabled");
|
||||||
if (val != priv->wireless_enabled) {
|
if (val != priv->wireless_enabled) {
|
||||||
priv->wireless_enabled = val;
|
priv->wireless_enabled = val;
|
||||||
g_object_notify (G_OBJECT (client), NM_CLIENT_WIRELESS_ENABLED);
|
poke = TRUE;
|
||||||
|
if (notify)
|
||||||
|
nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WIRELESS_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (poke)
|
||||||
|
poke_wireless_devices_with_rf_status (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
wireless_enabled_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||||
|
{
|
||||||
|
poke_wireless_devices_with_rf_status (NM_CLIENT (object));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -110,7 +143,7 @@ demarshal_active_connections (NMObject *object,
|
||||||
if (!nm_object_array_demarshal (value, (GPtrArray **) field, connection, nm_active_connection_new))
|
if (!nm_object_array_demarshal (value, (GPtrArray **) field, connection, nm_active_connection_new))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_CLIENT_ACTIVE_CONNECTIONS);
|
nm_object_queue_notify (object, NM_CLIENT_ACTIVE_CONNECTIONS);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -197,6 +230,9 @@ constructor (GType type,
|
||||||
g_error_free (err);
|
g_error_free (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_signal_connect (G_OBJECT (object), "notify::" NM_CLIENT_WIRELESS_ENABLED,
|
||||||
|
G_CALLBACK (wireless_enabled_cb), NULL);
|
||||||
|
|
||||||
return G_OBJECT (object);
|
return G_OBJECT (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -243,14 +279,14 @@ set_property (GObject *object, guint prop_id,
|
||||||
b = g_value_get_boolean (value);
|
b = g_value_get_boolean (value);
|
||||||
if (priv->wireless_enabled != b) {
|
if (priv->wireless_enabled != b) {
|
||||||
priv->wireless_enabled = b;
|
priv->wireless_enabled = b;
|
||||||
g_object_notify (object, NM_CLIENT_WIRELESS_ENABLED);
|
nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WIRELESS_ENABLED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_WIRELESS_HARDWARE_ENABLED:
|
case PROP_WIRELESS_HARDWARE_ENABLED:
|
||||||
b = g_value_get_boolean (value);
|
b = g_value_get_boolean (value);
|
||||||
if (priv->wireless_hw_enabled != b) {
|
if (priv->wireless_hw_enabled != b) {
|
||||||
priv->wireless_hw_enabled = b;
|
priv->wireless_hw_enabled = b;
|
||||||
g_object_notify (object, NM_CLIENT_WIRELESS_HARDWARE_ENABLED);
|
nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WIRELESS_HARDWARE_ENABLED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -412,12 +448,13 @@ proxy_name_owner_changed (DBusGProxy *proxy,
|
||||||
priv->manager_running = new_running;
|
priv->manager_running = new_running;
|
||||||
if (!priv->manager_running) {
|
if (!priv->manager_running) {
|
||||||
priv->state = NM_STATE_UNKNOWN;
|
priv->state = NM_STATE_UNKNOWN;
|
||||||
g_object_notify (G_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
|
nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
|
||||||
free_device_list (client);
|
free_device_list (client);
|
||||||
priv->wireless_enabled = FALSE;
|
priv->wireless_enabled = FALSE;
|
||||||
priv->wireless_hw_enabled = FALSE;
|
priv->wireless_hw_enabled = FALSE;
|
||||||
|
poke_wireless_devices_with_rf_status (client);
|
||||||
} else {
|
} else {
|
||||||
g_object_notify (G_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
|
nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
|
||||||
update_wireless_status (client, TRUE);
|
update_wireless_status (client, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ G_DEFINE_TYPE (NMDevice80211Wireless, nm_device_802_11_wireless, NM_TYPE_DEVICE)
|
||||||
|
|
||||||
static gboolean demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field);
|
static gboolean demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field);
|
||||||
|
|
||||||
|
void nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device, gboolean enabled);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gboolean disposed;
|
gboolean disposed;
|
||||||
DBusGProxy *proxy;
|
DBusGProxy *proxy;
|
||||||
|
|
@ -27,8 +29,11 @@ typedef struct {
|
||||||
int mode;
|
int mode;
|
||||||
guint32 rate;
|
guint32 rate;
|
||||||
NMAccessPoint *active_ap;
|
NMAccessPoint *active_ap;
|
||||||
|
gboolean null_active_ap;
|
||||||
guint32 wireless_caps;
|
guint32 wireless_caps;
|
||||||
GPtrArray *aps;
|
GPtrArray *aps;
|
||||||
|
|
||||||
|
gboolean wireless_enabled;
|
||||||
} NMDevice80211WirelessPrivate;
|
} NMDevice80211WirelessPrivate;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -177,6 +182,8 @@ nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *self)
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
||||||
if (priv->active_ap)
|
if (priv->active_ap)
|
||||||
return priv->active_ap;
|
return priv->active_ap;
|
||||||
|
if (priv->null_active_ap)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
path = nm_object_get_object_path_property (NM_OBJECT (self),
|
path = nm_object_get_object_path_property (NM_OBJECT (self),
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
||||||
|
|
@ -276,6 +283,44 @@ access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clean_up_aps (NMDevice80211Wireless *self, gboolean notify)
|
||||||
|
{
|
||||||
|
NMDevice80211WirelessPrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (NM_IS_DEVICE_802_11_WIRELESS (self));
|
||||||
|
|
||||||
|
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
if (priv->active_ap)
|
||||||
|
g_object_unref (priv->active_ap);
|
||||||
|
|
||||||
|
if (priv->aps) {
|
||||||
|
while (priv->aps->len) {
|
||||||
|
NMAccessPoint *ap = NM_ACCESS_POINT (g_ptr_array_index (priv->aps, 0));
|
||||||
|
|
||||||
|
if (notify)
|
||||||
|
g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
|
||||||
|
g_ptr_array_remove (priv->aps, ap);
|
||||||
|
g_object_unref (ap);
|
||||||
|
}
|
||||||
|
g_ptr_array_foreach (priv->aps, (GFunc) g_object_unref, NULL);
|
||||||
|
g_ptr_array_free (priv->aps, TRUE);
|
||||||
|
priv->aps = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device,
|
||||||
|
gboolean enabled)
|
||||||
|
{
|
||||||
|
g_return_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device));
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
|
clean_up_aps (device, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -335,13 +380,15 @@ state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
||||||
case NM_DEVICE_STATE_FAILED:
|
case NM_DEVICE_STATE_FAILED:
|
||||||
case NM_DEVICE_STATE_CANCELLED:
|
case NM_DEVICE_STATE_CANCELLED:
|
||||||
default:
|
default:
|
||||||
|
/* Just clear active AP; don't clear the AP list unless wireless is disabled completely */
|
||||||
if (priv->active_ap) {
|
if (priv->active_ap) {
|
||||||
g_object_unref (priv->active_ap);
|
g_object_unref (priv->active_ap);
|
||||||
priv->active_ap = NULL;
|
priv->active_ap = NULL;
|
||||||
|
priv->null_active_ap = FALSE;
|
||||||
}
|
}
|
||||||
g_object_notify (G_OBJECT (device), NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
||||||
priv->rate = 0;
|
priv->rate = 0;
|
||||||
g_object_notify (G_OBJECT (device), NM_DEVICE_802_11_WIRELESS_BITRATE);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_802_11_WIRELESS_BITRATE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -357,14 +404,20 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
|
||||||
if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
|
if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
priv->null_active_ap = FALSE;
|
||||||
|
|
||||||
path = g_value_get_boxed (value);
|
path = g_value_get_boxed (value);
|
||||||
if (path && strcmp (path, "/")) {
|
if (path) {
|
||||||
ap = NM_ACCESS_POINT (nm_object_cache_get (path));
|
if (!strcmp (path, "/"))
|
||||||
if (ap)
|
priv->null_active_ap = TRUE;
|
||||||
ap = g_object_ref (ap);
|
|
||||||
else {
|
else {
|
||||||
connection = nm_object_get_connection (object);
|
ap = NM_ACCESS_POINT (nm_object_cache_get (path));
|
||||||
ap = NM_ACCESS_POINT (nm_access_point_new (connection, path));
|
if (ap)
|
||||||
|
ap = g_object_ref (ap);
|
||||||
|
else {
|
||||||
|
connection = nm_object_get_connection (object);
|
||||||
|
ap = NM_ACCESS_POINT (nm_access_point_new (connection, path));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -376,7 +429,7 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
|
||||||
if (ap)
|
if (ap)
|
||||||
priv->active_ap = ap;
|
priv->active_ap = ap;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
nm_object_queue_notify (object, NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -455,15 +508,7 @@ dispose (GObject *object)
|
||||||
|
|
||||||
priv->disposed = TRUE;
|
priv->disposed = TRUE;
|
||||||
|
|
||||||
if (priv->active_ap)
|
clean_up_aps (NM_DEVICE_802_11_WIRELESS (object), FALSE);
|
||||||
g_object_unref (priv->active_ap);
|
|
||||||
|
|
||||||
if (priv->aps) {
|
|
||||||
g_ptr_array_foreach (priv->aps, (GFunc) g_object_unref, NULL);
|
|
||||||
g_ptr_array_free (priv->aps, TRUE);
|
|
||||||
priv->aps = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (priv->proxy);
|
g_object_unref (priv->proxy);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->dispose (object);
|
G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->dispose (object);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ typedef struct {
|
||||||
char *driver;
|
char *driver;
|
||||||
guint32 capabilities;
|
guint32 capabilities;
|
||||||
NMIP4Config *ip4_config;
|
NMIP4Config *ip4_config;
|
||||||
|
gboolean null_ip4_config;
|
||||||
NMDeviceState state;
|
NMDeviceState state;
|
||||||
char *product;
|
char *product;
|
||||||
char *vendor;
|
char *vendor;
|
||||||
|
|
@ -65,14 +66,20 @@ demarshal_ip4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
|
||||||
if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
|
if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
priv->null_ip4_config = FALSE;
|
||||||
|
|
||||||
path = g_value_get_boxed (value);
|
path = g_value_get_boxed (value);
|
||||||
if (strcmp (path, "/")) {
|
if (path) {
|
||||||
config = NM_IP4_CONFIG (nm_object_cache_get (path));
|
if (!strcmp (path, "/"))
|
||||||
if (config)
|
priv->null_ip4_config = TRUE;
|
||||||
config = g_object_ref (config);
|
|
||||||
else {
|
else {
|
||||||
connection = nm_object_get_connection (object);
|
config = NM_IP4_CONFIG (nm_object_cache_get (path));
|
||||||
config = NM_IP4_CONFIG (nm_ip4_config_new (connection, path));
|
if (config)
|
||||||
|
config = g_object_ref (config);
|
||||||
|
else {
|
||||||
|
connection = nm_object_get_connection (object);
|
||||||
|
config = NM_IP4_CONFIG (nm_ip4_config_new (connection, path));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,7 +91,7 @@ demarshal_ip4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
|
||||||
if (config)
|
if (config)
|
||||||
priv->ip4_config = config;
|
priv->ip4_config = config;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_DEVICE_IP4_CONFIG);
|
nm_object_queue_notify (object, NM_DEVICE_IP4_CONFIG);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -426,13 +433,17 @@ nm_device_get_ip4_config (NMDevice *device)
|
||||||
priv = NM_DEVICE_GET_PRIVATE (device);
|
priv = NM_DEVICE_GET_PRIVATE (device);
|
||||||
if (priv->ip4_config)
|
if (priv->ip4_config)
|
||||||
return priv->ip4_config;
|
return priv->ip4_config;
|
||||||
|
if (priv->null_ip4_config)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
path = nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Ip4Config");
|
path = nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Ip4Config");
|
||||||
|
if (path) {
|
||||||
|
g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH);
|
||||||
|
g_value_take_boxed (&value, path);
|
||||||
|
demarshal_ip4_config (NM_OBJECT (device), NULL, &value, &priv->ip4_config);
|
||||||
|
g_value_unset (&value);
|
||||||
|
}
|
||||||
|
|
||||||
g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH);
|
|
||||||
g_value_take_boxed (&value, path);
|
|
||||||
demarshal_ip4_config (NM_OBJECT (device), NULL, &value, &priv->ip4_config);
|
|
||||||
g_value_unset (&value);
|
|
||||||
return priv->ip4_config;
|
return priv->ip4_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -593,8 +604,8 @@ nm_device_update_description (NMDevice *device)
|
||||||
}
|
}
|
||||||
g_free (pd_parent_udi);
|
g_free (pd_parent_udi);
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (device), NM_DEVICE_VENDOR);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_VENDOR);
|
||||||
g_object_notify (G_OBJECT (device), NM_DEVICE_PRODUCT);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ demarshal_ip4_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!strcmp (pspec->name, NM_IP4_CONFIG_NAMESERVERS))
|
if (!strcmp (pspec->name, NM_IP4_CONFIG_NAMESERVERS))
|
||||||
g_object_notify (G_OBJECT (object), NM_IP4_CONFIG_NAMESERVERS);
|
nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS);
|
||||||
else if (!strcmp (pspec->name, NM_IP4_CONFIG_NIS_SERVERS))
|
else if (!strcmp (pspec->name, NM_IP4_CONFIG_NIS_SERVERS))
|
||||||
g_object_notify (G_OBJECT (object), NM_IP4_CONFIG_NAMESERVERS);
|
nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ demarshal_domains (NMObject *object, GParamSpec *pspec, GValue *value, gpointer
|
||||||
if (!nm_string_array_demarshal (value, (GPtrArray **) field))
|
if (!nm_string_array_demarshal (value, (GPtrArray **) field))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (object), NM_IP4_CONFIG_DOMAINS);
|
nm_object_queue_notify (object, NM_IP4_CONFIG_DOMAINS);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue