[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#126208: boot-floppies: First choose DHCP-Configure, then change to static



tag 126208 patch
thanks

On Sat, 2001-12-22 at 16:51, pb@nexus.co.uk wrote:
> Looks like configure_static_network() needs to take steps to kill off the
> DHCP daemons (pump and/or dhclient) if they're running.

How about the following patch?

--- netconfig.c.~1.78.~	Tue Dec 18 19:23:04 2001
+++ netconfig.c	Sun Dec 23 00:41:03 2001
@@ -845,6 +845,15 @@
       /* Down the interface to clear old gateways.  */
       snprintf(cmdline, MAXLINE, "/sbin/ifconfig %s down", netinterface);
       execlog(cmdline, LOG_INFO);
+      
+      /* Kill any dhcp client daemon that may have been running if the
+	 user previously chose DHCP */
+      if (NAME_ISEXE("/sbin/pump", &nc_statbuf))      
+	execlog("/sbin/pump -k", LOG_DEBUG);      
+      else if (NAME_ISEXE(NC_DHCLIENT_FILE, &nc_statbuf)) {
+	snprintf(cmdline, MAXLINE, "kill `pidof %s`", NC_DHCLIENT_FILE);
+	execlog(cmdline, LOG_DEBUG);
+      }
 
       snprintf(cmdline, MAXLINE-5, "/sbin/ifconfig %s %s netmask ",
                netinterface, IP4tostr(prtbuf, ipaddr));




Reply to: