2008-10-30 Dan Williams <dcbw@redhat.com>
* src/nm-device-ethernet.c src/nm-device-wifi.c src/nm-device.c src/ppp-manager/nm-ppp-manager.c - Harmonize return checking of ioctl * system-settings/plugins/ifcfg-fedora/reader.c - (is_wireless_device): fall back to SIOCGIWNAME (rh #466340) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4236 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1970,7 +1970,7 @@ nm_device_update_ip4_address (NMDevice *self)
|
||||
{
|
||||
struct ifreq req;
|
||||
guint32 new_address;
|
||||
int fd, err;
|
||||
int fd;
|
||||
|
||||
g_return_if_fail (self != NULL);
|
||||
|
||||
@@ -1982,15 +1982,12 @@ nm_device_update_ip4_address (NMDevice *self)
|
||||
|
||||
memset (&req, 0, sizeof (struct ifreq));
|
||||
strncpy (req.ifr_name, nm_device_get_ip_iface (self), IFNAMSIZ);
|
||||
err = ioctl (fd, SIOCGIFADDR, &req);
|
||||
if (ioctl (fd, SIOCGIFADDR, &req) == 0) {
|
||||
new_address = ((struct sockaddr_in *)(&req.ifr_addr))->sin_addr.s_addr;
|
||||
if (new_address != nm_device_get_ip4_address (self))
|
||||
self->priv->ip4_address = new_address;
|
||||
}
|
||||
close (fd);
|
||||
|
||||
if (err != 0)
|
||||
return;
|
||||
|
||||
new_address = ((struct sockaddr_in *)(&req.ifr_addr))->sin_addr.s_addr;
|
||||
if (new_address != nm_device_get_ip4_address (self))
|
||||
self->priv->ip4_address = new_address;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user