2006-01-16 Robert Love <rml@novell.com>
* gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c, gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c, gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c, src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c, src/nm-netlink-monitor.c: Don't miss any initializers on structure declarations, ever. * gnome/applet/applet.c: Remove useless check (NMState is unsigned and NM_STATE_DISCONNECTED is zero). git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1351 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2006-01-16 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
|
* gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c,
|
||||||
|
gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c,
|
||||||
|
gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c,
|
||||||
|
gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c,
|
||||||
|
src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c,
|
||||||
|
src/nm-netlink-monitor.c: Don't miss any initializers on structure
|
||||||
|
declarations, ever.
|
||||||
|
* gnome/applet/applet.c: Remove useless check (NMState is unsigned and
|
||||||
|
NM_STATE_DISCONNECTED is zero).
|
||||||
|
|
||||||
2006-01-16 Robert Love <rml@novell.com>
|
2006-01-16 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
* src/nm-device-802-11-wireless.c: argv[3], not argv[4]. Fix
|
* src/nm-device-802-11-wireless.c: argv[3], not argv[4]. Fix
|
||||||
|
@@ -2158,7 +2158,7 @@ static inline void nmwa_enable_networking_set_active (NMWirelessApplet *applet)
|
|||||||
void nmwa_set_state (NMWirelessApplet *applet, enum NMState state)
|
void nmwa_set_state (NMWirelessApplet *applet, enum NMState state)
|
||||||
{
|
{
|
||||||
g_return_if_fail (applet != NULL);
|
g_return_if_fail (applet != NULL);
|
||||||
g_return_if_fail (state >= NM_STATE_UNKNOWN && state <= NM_STATE_DISCONNECTED);
|
g_return_if_fail (state <= NM_STATE_DISCONNECTED);
|
||||||
applet->nm_state = state;
|
applet->nm_state = state;
|
||||||
nmwa_enable_networking_set_active (applet);
|
nmwa_enable_networking_set_active (applet);
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,8 @@ egg_tray_icon_get_type (void)
|
|||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (EggTrayIcon),
|
sizeof (EggTrayIcon),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) egg_tray_icon_init
|
(GInstanceInitFunc) egg_tray_icon_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
|
|
||||||
our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
|
our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
|
||||||
|
@@ -147,18 +147,19 @@ nm_gconf_wso_wep_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMGConfWSOWEPClass),
|
sizeof (NMGConfWSOWEPClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_gconf_wso_wep_class_init,
|
(GClassInitFunc) nm_gconf_wso_wep_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMGConfWSOWEP),
|
sizeof (NMGConfWSOWEP),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_gconf_wso_wep_init
|
(GInstanceInitFunc) nm_gconf_wso_wep_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_GCONF_WSO,
|
type = g_type_register_static (NM_TYPE_GCONF_WSO,
|
||||||
"NMGConfWSOWEP",
|
"NMGConfWSOWEP",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -164,18 +164,19 @@ nm_gconf_wso_wpa_psk_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMGConfWSOWPA_PSKClass),
|
sizeof (NMGConfWSOWPA_PSKClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_gconf_wso_wpa_psk_class_init,
|
(GClassInitFunc) nm_gconf_wso_wpa_psk_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMGConfWSOWPA_PSK),
|
sizeof (NMGConfWSOWPA_PSK),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_gconf_wso_wpa_psk_init
|
(GInstanceInitFunc) nm_gconf_wso_wpa_psk_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_GCONF_WSO,
|
type = g_type_register_static (NM_TYPE_GCONF_WSO,
|
||||||
"NMGConfWSOWPA_PSK",
|
"NMGConfWSOWPA_PSK",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -348,18 +348,19 @@ nm_gconf_wso_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMGConfWSOClass),
|
sizeof (NMGConfWSOClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_gconf_wso_class_init,
|
(GClassInitFunc) nm_gconf_wso_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMGConfWSO),
|
sizeof (NMGConfWSO),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_gconf_wso_init
|
(GInstanceInitFunc) nm_gconf_wso_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (G_TYPE_OBJECT,
|
type = g_type_register_static (G_TYPE_OBJECT,
|
||||||
"NMGConfWSO",
|
"NMGConfWSO",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -1071,9 +1071,9 @@ main (int argc, char *argv[])
|
|||||||
static gchar *import_file = NULL;
|
static gchar *import_file = NULL;
|
||||||
static GOptionEntry entries[] =
|
static GOptionEntry entries[] =
|
||||||
{
|
{
|
||||||
{ "import-service", 's', 0,G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL},
|
{ "import-service", 's', 0, G_OPTION_ARG_STRING, &import_svc, "VPN Service for importing", NULL},
|
||||||
{ "import-file", 'f', 0, G_OPTION_ARG_STRING, &import_file, "File to import", NULL},
|
{ "import-file", 'f', 0, G_OPTION_ARG_STRING, &import_file, "File to import", NULL},
|
||||||
{ NULL }
|
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
bindtextdomain (GETTEXT_PACKAGE, NULL);
|
bindtextdomain (GETTEXT_PACKAGE, NULL);
|
||||||
|
@@ -191,18 +191,19 @@ nm_ap_security_wep_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMAPSecurityWEPClass),
|
sizeof (NMAPSecurityWEPClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_ap_security_wep_class_init,
|
(GClassInitFunc) nm_ap_security_wep_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMAPSecurityWEP),
|
sizeof (NMAPSecurityWEP),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_ap_security_wep_init
|
(GInstanceInitFunc) nm_ap_security_wep_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_AP_SECURITY,
|
type = g_type_register_static (NM_TYPE_AP_SECURITY,
|
||||||
"NMAPSecurityWEP",
|
"NMAPSecurityWEP",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -244,18 +244,19 @@ nm_ap_security_wpa_psk_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMAPSecurityWPA_PSKClass),
|
sizeof (NMAPSecurityWPA_PSKClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_ap_security_wpa_psk_class_init,
|
(GClassInitFunc) nm_ap_security_wpa_psk_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMAPSecurityWPA_PSK),
|
sizeof (NMAPSecurityWPA_PSK),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_ap_security_wpa_psk_init
|
(GInstanceInitFunc) nm_ap_security_wpa_psk_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_AP_SECURITY,
|
type = g_type_register_static (NM_TYPE_AP_SECURITY,
|
||||||
"NMAPSecurityWPA_PSK",
|
"NMAPSecurityWPA_PSK",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -377,18 +377,20 @@ nm_ap_security_get_type (void)
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
static const GTypeInfo info = {
|
static const GTypeInfo info = {
|
||||||
sizeof (NMAPSecurityClass),
|
sizeof (NMAPSecurityClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_ap_security_class_init,
|
(GClassInitFunc) nm_ap_security_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMAPSecurity),
|
sizeof (NMAPSecurity),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_ap_security_init
|
(GInstanceInitFunc) nm_ap_security_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
|
|
||||||
type = g_type_register_static (G_TYPE_OBJECT,
|
type = g_type_register_static (G_TYPE_OBJECT,
|
||||||
"NMAPSecurity",
|
"NMAPSecurity",
|
||||||
&info, 0);
|
&info, 0);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@@ -2905,14 +2905,15 @@ nm_device_802_11_wireless_get_type (void)
|
|||||||
static const GTypeInfo info =
|
static const GTypeInfo info =
|
||||||
{
|
{
|
||||||
sizeof (NMDevice80211WirelessClass),
|
sizeof (NMDevice80211WirelessClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_device_802_11_wireless_class_init,
|
(GClassInitFunc) nm_device_802_11_wireless_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMDevice80211Wireless),
|
sizeof (NMDevice80211Wireless),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_device_802_11_wireless_init
|
(GInstanceInitFunc) nm_device_802_11_wireless_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_DEVICE,
|
type = g_type_register_static (NM_TYPE_DEVICE,
|
||||||
"NMDevice80211Wireless",
|
"NMDevice80211Wireless",
|
||||||
|
@@ -293,14 +293,15 @@ nm_device_802_3_ethernet_get_type (void)
|
|||||||
static const GTypeInfo info =
|
static const GTypeInfo info =
|
||||||
{
|
{
|
||||||
sizeof (NMDevice8023EthernetClass),
|
sizeof (NMDevice8023EthernetClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_device_802_3_ethernet_class_init,
|
(GClassInitFunc) nm_device_802_3_ethernet_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMDevice8023Ethernet),
|
sizeof (NMDevice8023Ethernet),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_device_802_3_ethernet_init
|
(GInstanceInitFunc) nm_device_802_3_ethernet_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (NM_TYPE_DEVICE,
|
type = g_type_register_static (NM_TYPE_DEVICE,
|
||||||
"NMDevice8023Ethernet",
|
"NMDevice8023Ethernet",
|
||||||
|
@@ -1977,14 +1977,15 @@ nm_device_get_type (void)
|
|||||||
static const GTypeInfo info =
|
static const GTypeInfo info =
|
||||||
{
|
{
|
||||||
sizeof (NMDeviceClass),
|
sizeof (NMDeviceClass),
|
||||||
NULL, /* base_init */
|
NULL, /* base_init */
|
||||||
NULL, /* base_finalize */
|
NULL, /* base_finalize */
|
||||||
(GClassInitFunc) nm_device_class_init,
|
(GClassInitFunc) nm_device_class_init,
|
||||||
NULL, /* class_finalize */
|
NULL, /* class_finalize */
|
||||||
NULL, /* class_data */
|
NULL, /* class_data */
|
||||||
sizeof (NMDevice),
|
sizeof (NMDevice),
|
||||||
0, /* n_preallocs */
|
0, /* n_preallocs */
|
||||||
(GInstanceInitFunc) nm_device_init
|
(GInstanceInitFunc) nm_device_init,
|
||||||
|
NULL /* value_table */
|
||||||
};
|
};
|
||||||
type = g_type_register_static (G_TYPE_OBJECT,
|
type = g_type_register_static (G_TYPE_OBJECT,
|
||||||
"NMDevice",
|
"NMDevice",
|
||||||
|
@@ -136,7 +136,7 @@ gboolean
|
|||||||
nm_netlink_monitor_open_connection (NmNetlinkMonitor *monitor,
|
nm_netlink_monitor_open_connection (NmNetlinkMonitor *monitor,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
struct sockaddr_nl monitor_address = { 0 };
|
struct sockaddr_nl monitor_address = { .nl_family = 0 };
|
||||||
int fd, saved_errno;
|
int fd, saved_errno;
|
||||||
GError *channel_error;
|
GError *channel_error;
|
||||||
GIOFlags channel_flags;
|
GIOFlags channel_flags;
|
||||||
@@ -323,8 +323,9 @@ nm_netlink_monitor_request_status (NmNetlinkMonitor *monitor,
|
|||||||
struct nlmsghdr header;
|
struct nlmsghdr header;
|
||||||
struct rtgenmsg request;
|
struct rtgenmsg request;
|
||||||
} NmNetlinkMonitorStatusPacket;
|
} NmNetlinkMonitorStatusPacket;
|
||||||
NmNetlinkMonitorStatusPacket packet = { { 0 } };
|
|
||||||
struct sockaddr_nl recipient = { 0 };
|
NmNetlinkMonitorStatusPacket packet;
|
||||||
|
struct sockaddr_nl recipient = { .nl_pad = 0 };
|
||||||
static guint32 sequence_number;
|
static guint32 sequence_number;
|
||||||
int fd, saved_errno;
|
int fd, saved_errno;
|
||||||
ssize_t num_bytes_sent;
|
ssize_t num_bytes_sent;
|
||||||
@@ -339,6 +340,7 @@ nm_netlink_monitor_request_status (NmNetlinkMonitor *monitor,
|
|||||||
recipient.nl_pid = 0; /* going to kernel */
|
recipient.nl_pid = 0; /* going to kernel */
|
||||||
recipient.nl_groups = RTMGRP_LINK;
|
recipient.nl_groups = RTMGRP_LINK;
|
||||||
|
|
||||||
|
memset (&packet, 0, sizeof (NmNetlinkMonitorStatusPacket));
|
||||||
packet.header.nlmsg_len = NLMSG_LENGTH (sizeof (struct rtgenmsg));
|
packet.header.nlmsg_len = NLMSG_LENGTH (sizeof (struct rtgenmsg));
|
||||||
packet.header.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
|
packet.header.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
|
||||||
packet.header.nlmsg_type = RTM_GETLINK;
|
packet.header.nlmsg_type = RTM_GETLINK;
|
||||||
@@ -432,7 +434,7 @@ receive_pending_bytes (GIOChannel *channel,
|
|||||||
GString *pending_bytes;
|
GString *pending_bytes;
|
||||||
ssize_t num_bytes_read;
|
ssize_t num_bytes_read;
|
||||||
gboolean succeeded;
|
gboolean succeeded;
|
||||||
struct sockaddr_nl sender = { 0 };
|
struct sockaddr_nl sender = { .nl_pad = 0 };
|
||||||
gchar buffer[4096];
|
gchar buffer[4096];
|
||||||
static const size_t buffer_capacity = (size_t) sizeof (buffer);
|
static const size_t buffer_capacity = (size_t) sizeof (buffer);
|
||||||
socklen_t sender_size;
|
socklen_t sender_size;
|
||||||
|
Reference in New Issue
Block a user