2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c - (nm_dhcp_manager_get_ip4_config): clean up; update for changes to NMIP4Config to support multiple IP addresses * src/NetworkManagerUtils.c - (nm_utils_merge_ip4_config): update for multiple IP addresses * src/nm-ip4-config.c src/nm-ip4-config.h - Store a list of IPv4 address/netmask/gateway tuples - (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway, nm_ip4_config_get_netmask, nm_ip4_config_set_netmask, nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast, nm_ip4_config_set_address): remove - (nm_ip4_config_take_address, nm_ip4_config_add_address, nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses): new functions; handle multiple IPv4 addresses * src/nm-device.c src/ppp-manager/nm-ppp-manager.c src/vpn-manager/nm-vpn-connection.c src/NetworkManagerPolicy.c test/nm-tool.c libnm-glib/libnm-glib-test.c - update for changes to NMIP4Config for multiple IPv4 addresses * src/NetworkManagerSystem.c - (nm_system_device_set_ip4_route): don't add the route if any address is on the same subnet as the destination - (check_one_address): ignore the exact match, just match family and interface index - (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to an interface - (nm_system_device_set_from_ip4_config): use add_ip4_addresses() - (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses() * introspection/nm-ip4-config.xml - Remove 'address', 'gateway', 'netmask', and 'broadcast' properties - Add 'addresses' property which is an array of (uuu) tuples of address/netmask/gateway * libnm-util/nm-setting-ip4-config.c - (set_property): use ip-address <-> GValue converters from nm-utils.c * libnm-glib/nm-ip4-config.c libnm-glib/nm-ip4-config.h - Handle D-Bus interface changes to support multiple IP addresses git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -618,21 +618,21 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self)
|
||||
NMIP4Config *
|
||||
nm_device_new_ip4_autoip_config (NMDevice *self)
|
||||
{
|
||||
struct in_addr ip;
|
||||
NMIP4Config * config = NULL;
|
||||
struct in_addr ip;
|
||||
NMIP4Config *config = NULL;
|
||||
NMSettingIP4Address *addr;
|
||||
|
||||
g_return_val_if_fail (self != NULL, NULL);
|
||||
|
||||
// FIXME: make our autoip implementation not suck; use avahi-autoip
|
||||
if (get_autoip (self, &ip)) {
|
||||
#define LINKLOCAL_BCAST 0xa9feffff
|
||||
if (!get_autoip (self, &ip))
|
||||
return NULL;
|
||||
|
||||
config = nm_ip4_config_new ();
|
||||
nm_ip4_config_set_address (config, (guint32)(ip.s_addr));
|
||||
nm_ip4_config_set_netmask (config, (guint32)(ntohl (0xFFFF0000)));
|
||||
nm_ip4_config_set_broadcast (config, (guint32)(ntohl (LINKLOCAL_BCAST)));
|
||||
nm_ip4_config_set_gateway (config, 0);
|
||||
}
|
||||
config = nm_ip4_config_new ();
|
||||
addr = g_malloc0 (sizeof (NMSettingIP4Address));
|
||||
addr->address = (guint32) ip.s_addr;
|
||||
addr->netmask = (guint32) ntohl (0xFFFF0000);
|
||||
nm_ip4_config_take_address (config, addr);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
Reference in New Issue
Block a user