Index: src/dhcpconfig.c =================================================================== --- src/dhcpconfig.c (revision 60) +++ src/dhcpconfig.c (working copy) @@ -122,9 +122,12 @@ argc[1]=hostinfo_file; argc[2]=prm; argc[3]=NULL; - if ( execve(exec_on_change,argc,ProgramEnviron) && errno != ENOENT ) - logger(LOG_ERR,"error executing \"%s %s %s\": %s", - exec_on_change,hostinfo_file,prm,strerror(errno)); + logger(LOG_DEBUG, "about to exec \"%s %s %s\"", exec_on_change, + hostinfo_file, prm); + if ( execve(exec_on_change,argc,ProgramEnviron) && + ( errno != ENOENT || Cfilename ) ) + logger(LOG_ERR, "error executing \"%s %s %s\": %s", + exec_on_change,hostinfo_file, prm, strerror(errno)); exit(0); } } @@ -785,19 +788,7 @@ } else logger(LOG_ERR,"dhcpConfig: fopen %s: %s", hostinfo_file, strerror(errno)); -#if 0 - if ( Cfilename ) - if ( fork() == 0 ) - { - char *argc[2]; - argc[0]=Cfilename; - argc[1]=NULL; - if ( execve(Cfilename,argc,ProgramEnviron) ) - logger(LOG_ERR,"error executing \"%s\": %s", - Cfilename,strerror(errno)); - exit(0); - } -#endif + if ( DhcpIface.ciaddr == prev_ip_addr ) execute_on_change("up"); else /* IP address has changed */ @@ -805,11 +796,7 @@ execute_on_change("new"); prev_ip_addr=DhcpIface.ciaddr; } -/* if ( *(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime] == 0xffffffff ) - { - logger(LOG_INFO,"infinite IP address lease time. Exiting"); - exit(0); - } */ + return 0; } /*****************************************************************************/ Index: src/dhcpcd.8 =================================================================== --- src/dhcpcd.8 (revision 60) +++ src/dhcpcd.8 (working copy) @@ -48,7 +48,8 @@ .SH OPTIONS -.TP \-a +.TP +.BI \-a Don't do an .B ARP check on the IP address give to us by the DHCP server. Normally we do this to Index: src/client.c =================================================================== --- src/client.c (revision 60) +++ src/client.c (working copy) @@ -1122,7 +1122,8 @@ /*****************************************************************************/ void *dhcpBound() { - int i, maxfd; + unsigned int i; + int maxfd; fd_set rset; char foobuf[512]; @@ -1175,7 +1176,7 @@ /*****************************************************************************/ void *dhcpRenew() { - int i; + unsigned int i; if ( sigsetjmp(env,0xffff) ) return &dhcpRebind; i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpT2value])-time(NULL); if ( i > 0 ) @@ -1205,7 +1206,7 @@ /*****************************************************************************/ void *dhcpRebind() { - int i; + unsigned int i; if ( sigsetjmp(env,0xffff) ) return &dhcpStop; i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime])-time(NULL); if ( i > 0 ) Index: src/dhcpcd.c =================================================================== --- src/dhcpcd.c (revision 60) +++ src/dhcpcd.c (working copy) @@ -198,8 +198,7 @@ if ((LogLevel = log_to_level(argc[i])) < 0) LogLevel = atoi(argc[i]); i++; - s=1; - goto prgs; + break; case 'd': s++; LogLevel = log_to_level("LOG_DEBUG"); Index: ChangeLog =================================================================== --- ChangeLog (revision 61) +++ ChangeLog (working copy) @@ -1,3 +1,13 @@ +21 Jun 2006; Roy Marples + + Always report exec errors when -c is used, Gentoo bug #137478. + + Use a unsigned int instead of an int when comparing alarm time > 0. + + Fixed man page by putting the option -a against its description. + + Fixed segfault when using the -v option. + ** dhcpcd-2.0.6 Released 02 Jun 2006; Roy Marples