All I want to do is change the default interface!!!

David Wuertele dave-gnus at
Tue Nov 18 00:38:04 GMT 2003

OK, this is not working.  I'm running the following in a loop, where
ilp->name is a different value (like "eth0", "eth1", etc) each time
the loop goes around:

      unlink (TMPCONF_FILENAME);
      tmpconf = fopen (TMPCONF_FILENAME, "w");
      fprintf (tmpconf, "interfaces = %s\n", ilp->name);
      fclose (tmpconf);
      retval = lp_load (TMPCONF_FILENAME, True, False, False);
      interface_name = str_list_make (ilp->name, 0);
      lp_do_parameter (GLOBAL_SECTION_SNUM, "interfaces", ilp->name);
      smbc_init(auth_fn, 0);
      setup_logging("read-all-browse-lists", False);
      dh = smbc_opendir(url);

All I want to do is change the default interface.  The above works,
but only if smbc_opendir(url); has never been run with this URL

I thought that by blowing away the cache, I would get to use the new
ilp->name.  How can I reset the interface to be ONLY the one I want at
the time?

I've looked all through loadparm.c, but it is very confusing.  Is
there an API for just changing the "interfaces =" setting?


More information about the samba-technical mailing list