Revert scanning interval back to 10s, blow away resolv.conf for ad-hoc networks

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@344 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2004-12-17 21:39:23 +00:00
parent eb755d2d3a
commit d12bd5843a
5 changed files with 12 additions and 11 deletions

View File

@@ -727,7 +727,7 @@ int main( int argc, char *argv[] )
policy_source_id = g_source_attach (policy_source, nm_data->main_context); policy_source_id = g_source_attach (policy_source, nm_data->main_context);
/* Keep a current list of access points */ /* Keep a current list of access points */
wscan_source = g_timeout_source_new (15000); wscan_source = g_timeout_source_new (10000);
g_source_set_callback (wscan_source, nm_wireless_scan_monitor, nm_data, NULL); g_source_set_callback (wscan_source, nm_wireless_scan_monitor, nm_data, NULL);
wscan_source_id = g_source_attach (wscan_source, nm_data->main_context); wscan_source_id = g_source_attach (wscan_source, nm_data->main_context);

View File

@@ -711,10 +711,10 @@ void nm_ap_list_print_members (NMAccessPointList *list, const char *name)
while ((ap = nm_ap_list_iter_next (iter))) while ((ap = nm_ap_list_iter_next (iter)))
{ {
const GTimeVal *timestamp = nm_ap_get_timestamp (ap); const GTimeVal *timestamp = nm_ap_get_timestamp (ap);
syslog (LOG_DEBUG, "\t%d)\tessid='%s', timestamp=%ld, key='%s', enc=%d, addr=%p, strength=%d, freq=%f, rate=%d, inval=%d", syslog (LOG_DEBUG, "\t%d)\tobj=%p, essid='%s', timestamp=%ld, key='%s', enc=%d, addr=%p, strength=%d, freq=%f, rate=%d, inval=%d, mode=%d",
i, nm_ap_get_essid (ap), timestamp->tv_sec, nm_ap_get_enc_key_source (ap), nm_ap_get_encrypted (ap), i, ap, nm_ap_get_essid (ap), timestamp->tv_sec, nm_ap_get_enc_key_source (ap), nm_ap_get_encrypted (ap),
nm_ap_get_address (ap), nm_ap_get_strength (ap), nm_ap_get_freq (ap), nm_ap_get_rate (ap), nm_ap_get_address (ap), nm_ap_get_strength (ap), nm_ap_get_freq (ap), nm_ap_get_rate (ap),
nm_ap_get_invalid (ap)); nm_ap_get_invalid (ap), nm_ap_get_mode (ap));
i++; i++;
} }
syslog (LOG_DEBUG, "AP_LIST_PRINT: done"); syslog (LOG_DEBUG, "AP_LIST_PRINT: done");

View File

@@ -106,6 +106,9 @@ gboolean nm_device_do_autoip (NMDevice *dev)
/* Set all traffic to go through the device */ /* Set all traffic to go through the device */
nm_system_flush_loopback_routes (); nm_system_flush_loopback_routes ();
nm_system_device_add_default_route_via_device (dev); nm_system_device_add_default_route_via_device (dev);
/* Kill old resolv.conf */
nm_system_device_update_resolv_conf (NULL, 0, "");
} }
return (success); return (success);

View File

@@ -655,7 +655,7 @@ char * nm_device_get_essid (NMDevice *dev)
dev->options.wireless.cur_essid = g_strdup (info.essid); dev->options.wireless.cur_essid = g_strdup (info.essid);
} }
else else
syslog (LOG_ERR, "nm_device_get_essid(): error setting ESSID for device %s. errno = %d", nm_device_get_iface (dev), errno); syslog (LOG_ERR, "nm_device_get_essid(): error getting ESSID for device %s. errno = %d", nm_device_get_iface (dev), errno);
close (iwlib_socket); close (iwlib_socket);
} }
@@ -706,7 +706,7 @@ void nm_device_set_essid (NMDevice *dev, const char *essid)
err = iw_set_ext (iwlib_socket, nm_device_get_iface (dev), SIOCSIWESSID, &wreq); err = iw_set_ext (iwlib_socket, nm_device_get_iface (dev), SIOCSIWESSID, &wreq);
if (err == -1) if (err == -1)
syslog (LOG_ERR, "nm_device_set_essid(): error setting ESSID for device %s. errno = %d", nm_device_get_iface (dev), errno); syslog (LOG_ERR, "nm_device_set_essid(): error setting ESSID '%s' for device %s. errno = %d", safe_essid, nm_device_get_iface (dev), errno);
close (iwlib_socket); close (iwlib_socket);
} }
@@ -3017,7 +3017,7 @@ static void nm_device_do_normal_scan (NMDevice *dev)
nm_ap_list_unref (earliest_scan); nm_ap_list_unref (earliest_scan);
/* Now do a diff of the old and new networks that we can see, and /* Now do a diff of the old and new networks that we can see, and
* signal any changes over dbus, but only if we are active device. * signal any changes over dbus.
*/ */
nm_ap_list_diff (dev->app_data, dev, old_ap_list, nm_device_ap_list_get (dev)); nm_ap_list_diff (dev->app_data, dev, old_ap_list, nm_device_ap_list_get (dev));
if (old_ap_list) if (old_ap_list)

View File

@@ -223,18 +223,16 @@ gboolean nm_system_device_update_resolv_conf (void *data, int len, const char *d
{ {
FILE *f; FILE *f;
g_return_val_if_fail (data != NULL, FALSE);
if ((f = fopen ("/etc/resolv.conf", "w"))) if ((f = fopen ("/etc/resolv.conf", "w")))
{ {
int i; int i;
fprintf (f, "; generated by NetworkManager\n"); fprintf (f, "; generated by NetworkManager\n");
if (domain_name) if (domain_name && strlen (domain_name))
fprintf (f, "search %s\n", (char *)domain_name); fprintf (f, "search %s\n", (char *)domain_name);
for (i = 0; i < len; i += 4) for (i = 0; data && (i < len); i += 4)
{ {
fprintf (f,"nameserver %u.%u.%u.%u\n", fprintf (f,"nameserver %u.%u.%u.%u\n",
((unsigned char *)data)[i], ((unsigned char *)data)[i],