Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 137478 | Differences between
and this patch

Collapse All | Expand All

(-)src/dhcpconfig.c (-21 / +8 lines)
Lines 122-130 Link Here
122
      argc[1]=hostinfo_file;
122
      argc[1]=hostinfo_file;
123
      argc[2]=prm;
123
      argc[2]=prm;
124
      argc[3]=NULL;
124
      argc[3]=NULL;
125
      if ( execve(exec_on_change,argc,ProgramEnviron) && errno != ENOENT )
125
      logger(LOG_DEBUG, "about to exec \"%s %s %s\"", exec_on_change,
126
	logger(LOG_ERR,"error executing \"%s %s %s\": %s",
126
	     hostinfo_file, prm);
127
	exec_on_change,hostinfo_file,prm,strerror(errno));
127
      if ( execve(exec_on_change,argc,ProgramEnviron) && 
128
	   ( errno != ENOENT || Cfilename ) )
129
	logger(LOG_ERR, "error executing \"%s %s %s\": %s",
130
	       exec_on_change,hostinfo_file, prm, strerror(errno));
128
      exit(0);
131
      exit(0);
129
    }
132
    }
130
}
133
}
Lines 785-803 Link Here
785
    }
788
    }
786
  else
789
  else
787
    logger(LOG_ERR,"dhcpConfig: fopen %s: %s", hostinfo_file, strerror(errno));
790
    logger(LOG_ERR,"dhcpConfig: fopen %s: %s", hostinfo_file, strerror(errno));
788
#if 0
791
  
789
  if ( Cfilename )
790
    if ( fork() == 0 )
791
      {
792
	char *argc[2];
793
	argc[0]=Cfilename;
794
	argc[1]=NULL;
795
	if ( execve(Cfilename,argc,ProgramEnviron) )
796
	  logger(LOG_ERR,"error executing \"%s\": %s",
797
	  Cfilename,strerror(errno));
798
	exit(0);
799
      }
800
#endif
801
  if ( DhcpIface.ciaddr == prev_ip_addr )
792
  if ( DhcpIface.ciaddr == prev_ip_addr )
802
    execute_on_change("up");
793
    execute_on_change("up");
803
  else					/* IP address has changed */
794
  else					/* IP address has changed */
Lines 805-815 Link Here
805
      execute_on_change("new");
796
      execute_on_change("new");
806
      prev_ip_addr=DhcpIface.ciaddr;
797
      prev_ip_addr=DhcpIface.ciaddr;
807
    }
798
    }
808
/*  if ( *(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime] == 0xffffffff )
799
  
809
    {
810
      logger(LOG_INFO,"infinite IP address lease time. Exiting");
811
      exit(0);
812
    } */
813
  return 0;
800
  return 0;
814
}
801
}
815
/*****************************************************************************/
802
/*****************************************************************************/
(-)src/dhcpcd.8 (-1 / +2 lines)
Lines 48-54 Link Here
48
48
49
49
50
.SH OPTIONS
50
.SH OPTIONS
51
.TP \-a
51
.TP
52
.BI \-a
52
Don't do an
53
Don't do an
53
.B ARP
54
.B ARP
54
check on the IP address give to us by the DHCP server. Normally we do this to
55
check on the IP address give to us by the DHCP server. Normally we do this to
(-)src/client.c (-3 / +4 lines)
Lines 1122-1128 Link Here
1122
/*****************************************************************************/
1122
/*****************************************************************************/
1123
void *dhcpBound()
1123
void *dhcpBound()
1124
{
1124
{
1125
  int i, maxfd;
1125
  unsigned int i;
1126
  int maxfd;
1126
  fd_set rset;
1127
  fd_set rset;
1127
  char foobuf[512];
1128
  char foobuf[512];
1128
1129
Lines 1175-1181 Link Here
1175
/*****************************************************************************/
1176
/*****************************************************************************/
1176
void *dhcpRenew()
1177
void *dhcpRenew()
1177
{
1178
{
1178
  int i;
1179
  unsigned int i;
1179
  if ( sigsetjmp(env,0xffff) ) return &dhcpRebind;
1180
  if ( sigsetjmp(env,0xffff) ) return &dhcpRebind;
1180
  i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpT2value])-time(NULL);
1181
  i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpT2value])-time(NULL);
1181
  if ( i > 0 )
1182
  if ( i > 0 )
Lines 1205-1211 Link Here
1205
/*****************************************************************************/
1206
/*****************************************************************************/
1206
void *dhcpRebind()
1207
void *dhcpRebind()
1207
{
1208
{
1208
  int i;
1209
  unsigned int i;
1209
  if ( sigsetjmp(env,0xffff) ) return &dhcpStop;
1210
  if ( sigsetjmp(env,0xffff) ) return &dhcpStop;
1210
  i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime])-time(NULL);
1211
  i = ReqSentTime+ntohl(*(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime])-time(NULL);
1211
  if ( i > 0 )
1212
  if ( i > 0 )
(-)src/dhcpcd.c (-2 / +1 lines)
Lines 198-205 Link Here
198
	    if ((LogLevel = log_to_level(argc[i])) < 0)
198
	    if ((LogLevel = log_to_level(argc[i])) < 0)
199
		    LogLevel = atoi(argc[i]);
199
		    LogLevel = atoi(argc[i]);
200
	    i++;
200
	    i++;
201
	    s=1;
201
	    break;
202
	    goto prgs;
203
	  case 'd':
202
	  case 'd':
204
	    s++;
203
	    s++;
205
	    LogLevel = log_to_level("LOG_DEBUG");
204
	    LogLevel = log_to_level("LOG_DEBUG");
(-)ChangeLog (+10 lines)
Lines 1-3 Link Here
1
21 Jun 2006; Roy Marples <uberlord@gentoo.org>
2
3
   Always report exec errors when -c is used, Gentoo bug #137478.
4
   
5
   Use a unsigned int instead of an int when comparing alarm time > 0.
6
7
   Fixed man page by putting the option -a against its description.
8
9
   Fixed segfault when using the -v option.
10
1
** dhcpcd-2.0.6 Released
11
** dhcpcd-2.0.6 Released
2
12
3
02 Jun 2006; Roy Marples <uberlord@gentoo.org>
13
02 Jun 2006; Roy Marples <uberlord@gentoo.org>

Return to bug 137478