diff --git a/ChangeLog b/ChangeLog index 6fe8452d4..3c7cf0aec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-01-21 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (ip4_config_get): set peer address too + + * src/ppp-manager/nm-pppd-plugin.c + - (nm_ip_up): try harder to get the peer's address + + * src/NetworkManagerSystem.c + - (nm_system_device_set_from_ip4_config): if the IP4Config has a peer + address, use that too. Otherwise, some PPP connections won't work. + 2008-01-19 Dan Williams * src/NetworkManagerPolicy.c diff --git a/src/NetworkManagerSystem.c b/src/NetworkManagerSystem.c index e23097803..faec48e22 100644 --- a/src/NetworkManagerSystem.c +++ b/src/NetworkManagerSystem.c @@ -195,6 +195,7 @@ nm_system_device_set_from_ip4_config (const char *iface, struct rtnl_addr * addr = NULL; int err; int len, i; + guint32 flags; g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (config != NULL, FALSE); @@ -208,7 +209,11 @@ nm_system_device_set_from_ip4_config (const char *iface, nm_system_device_flush_routes_with_iface (iface); nm_system_flush_arp_cache (); - if ((addr = nm_ip4_config_to_rtnl_addr (config, NM_RTNL_ADDR_DEFAULT))) { + flags = NM_RTNL_ADDR_DEFAULT; + if (nm_ip4_config_get_ptp_address (config)) + flags |= NM_RTNL_ADDR_PTP_ADDR; + + if ((addr = nm_ip4_config_to_rtnl_addr (config, flags))) { rtnl_addr_set_ifindex (addr, nm_netlink_iface_to_index (iface)); if ((err = rtnl_addr_add (nlh, addr, 0)) < 0) diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index a3b4aef3c..b75d5def5 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -314,8 +314,10 @@ ip4_config_get (DBusGProxy *proxy, config = nm_ip4_config_new (); val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_GATEWAY); - if (val) + if (val) { nm_ip4_config_set_gateway (config, g_value_get_uint (val)); + nm_ip4_config_set_ptp_address (config, g_value_get_uint (val)); + } val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_ADDRESS); if (val) diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c index 144d086d1..baf83b617 100644 --- a/src/ppp-manager/nm-pppd-plugin.c +++ b/src/ppp-manager/nm-pppd-plugin.c @@ -239,6 +239,7 @@ nm_ip_up (void *data, int arg) { NMPppdPlugin *plugin = NM_PPPD_PLUGIN (data); ipcp_options opts = ipcp_gotoptions[ifunit]; + ipcp_options peer_opts = ipcp_hisoptions[ifunit]; GHashTable *hash; GArray *array; GValue *val; @@ -253,10 +254,18 @@ nm_ip_up (void *data, int arg) g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_INTERFACE, str_to_gvalue (ifname)); + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_ADDRESS, uint_to_gvalue (opts.ouraddr)); - g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, - uint_to_gvalue (opts.hisaddr)); + + if (opts.hisaddr) { + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (opts.hisaddr)); + } else if (peer_opts.hisaddr) { + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (peer_opts.hisaddr)); + } + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_NETMASK, uint_to_gvalue (0xFFFFFFFF));