Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 23428
Collapse All | Expand All

(-)dhcpcd-1.3.22-pl4-orig/client.c (-2 / +8 lines)
Lines 1076-1085 Link Here
1076
  return &dhcpBound;
1076
  return &dhcpBound;
1077
}
1077
}
1078
/*****************************************************************************/
1078
/*****************************************************************************/
1079
void *dhcpRelease()
1079
void *dhcpRelease(int deleteCacheFlag)
1080
{
1080
{
1081
  struct sockaddr addr;
1081
  struct sockaddr addr;
1082
  deleteDhcpCache();
1082
  if ( deleteCacheFlag ) {
1083
    if ( DebugFlag ) syslog (LOG_DEBUG,"Deleting Dhcp Cache");
1084
    deleteDhcpCache();
1085
  } else {
1086
    if ( DebugFlag ) syslog (LOG_DEBUG,"Not Deleting Dhcp Cache");
1087
  }
1088
    
1083
  if ( DhcpIface.ciaddr == 0 ) return &dhcpInit;
1089
  if ( DhcpIface.ciaddr == 0 ) return &dhcpInit;
1084
1090
1085
  buildDhcpRelease(random());
1091
  buildDhcpRelease(random());
(-)dhcpcd-1.3.22-pl4-orig/client.h (-1 / +1 lines)
Lines 197-203 Link Here
197
void *dhcpBound();
197
void *dhcpBound();
198
void *dhcpRenew();
198
void *dhcpRenew();
199
void *dhcpRebind();
199
void *dhcpRebind();
200
void *dhcpRelease();
200
void *dhcpRelease(int deleteCacheFlag);
201
void *dhcpStop();
201
void *dhcpStop();
202
void *dhcpInform();
202
void *dhcpInform();
203
#ifdef ARPCHECK
203
#ifdef ARPCHECK
(-)dhcpcd-1.3.22-pl4-orig/dhcpcd.8 (-2 / +17 lines)
Lines 9-15 Link Here
9
.in +.5i
9
.in +.5i
10
.ti -.5i
10
.ti -.5i
11
dhcpcd
11
dhcpcd
12
\%[\-dknrBCDHNRSTY]
12
\%[\-dknrzBCDHNRSTY]
13
\%[\-t\ <timeout>]
13
\%[\-t\ <timeout>]
14
\%[\-c\ <ExecFilePath>]
14
\%[\-c\ <ExecFilePath>]
15
\%[-h\ <hostname>]
15
\%[-h\ <hostname>]
Lines 76-82 Link Here
76
receives
76
receives
77
.B SIGHUP
77
.B SIGHUP
78
it will send
78
it will send
79
.B DCHP_RELEASE
79
.B DHCP_RELEASE
80
message to the server and destroy dhcpcd cache. In a case
80
message to the server and destroy dhcpcd cache. In a case
81
.B dhcpcd
81
.B dhcpcd
82
receives
82
receives
Lines 93-98 Link Here
93
from DHCP server which was assigned before the
93
from DHCP server which was assigned before the
94
system went down.
94
system went down.
95
.TP
95
.TP
96
.BI \-z
97
Sends
98
.B SIGUSR1
99
signal to the 
100
.B dhcpcd
101
process that is currently running. If
102
.B dhcpcd
103
receives
104
.B SIGUSR1
105
it will send
106
.B DHCP_RELEASE
107
message to the server
108
.B without
109
destroying the dhcpcd cache.
110
.TP
96
.BI \-n
111
.BI \-n
97
Sends
112
Sends
98
.B SIGALRM
113
.B SIGALRM
(-)dhcpcd-1.3.22-pl4-orig/dhcpcd.c (-1 / +5 lines)
Lines 141-146 Link Here
141
	    s++;
141
	    s++;
142
	    killFlag=SIGALRM;
142
	    killFlag=SIGALRM;
143
	    goto prgs;
143
	    goto prgs;
144
	  case 'z':
145
	    s++;
146
	    killFlag=SIGUSR1;
147
	    goto prgs;
144
	  case 'd':
148
	  case 'd':
145
	    s++;
149
	    s++;
146
	    DebugFlag=1;
150
	    DebugFlag=1;
Lines 325-331 Link Here
325
          default:
329
          default:
326
usage:	    print_version();
330
usage:	    print_version();
327
	    fprintf(stderr,
331
	    fprintf(stderr,
328
"Usage: dhcpcd [-dknrBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
332
"Usage: dhcpcd [-dknrzBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
329
       [-i vendorClassID] [-I ClientID] [-c filename] [-s [ipaddr]]\n\
333
       [-i vendorClassID] [-I ClientID] [-c filename] [-s [ipaddr]]\n\
330
       [-w windowsize] [-L ConfigDir] [-G [gateway]] [interface]\n");
334
       [-w windowsize] [-L ConfigDir] [-G [gateway]] [interface]\n");
331
	    exit(1);
335
	    exit(1);
(-)dhcpcd-1.3.22-pl4-orig/dhcpconfig.c (+10 lines)
Lines 334-339 Link Here
334
    ((unsigned char *)&DhcpIface.ciaddr)[1],
334
    ((unsigned char *)&DhcpIface.ciaddr)[1],
335
    ((unsigned char *)&DhcpIface.ciaddr)[2],
335
    ((unsigned char *)&DhcpIface.ciaddr)[2],
336
    ((unsigned char *)&DhcpIface.ciaddr)[3]);
336
    ((unsigned char *)&DhcpIface.ciaddr)[3]);
337
338
  /* In the case where machine dies for some reason, resolv.conf.sv would
339
   * not have been restored to original glory
340
   */
341
  if ( 1+rename(""RESOLV_CONF".sv",RESOLV_CONF) ) {
342
    if ( DebugFlag ) syslog (LOG_DEBUG, "Restored resolv.conf.sv from improper shutdown");
343
  } else {
344
    if ( DebugFlag ) syslog (LOG_DEBUG, "No resolv.conf.sv to restore");
345
  }
346
337
  if ( ReplResolvConf )
347
  if ( ReplResolvConf )
338
    {
348
    {
339
      resolv_renamed=1+rename(RESOLV_CONF,""RESOLV_CONF".sv");
349
      resolv_renamed=1+rename(RESOLV_CONF,""RESOLV_CONF".sv");
(-)dhcpcd-1.3.22-pl4-orig/signals.c (-7 / +9 lines)
Lines 114-126 Link Here
114
  else
114
  else
115
    {
115
    {
116
      if ( sig == SIGHUP ) 
116
      if ( sig == SIGHUP ) 
117
	{
117
	/* Dhcp release with Cache file deletion */
118
	  dhcpRelease();
118
        dhcpRelease(1);
119
	  /* allow time for final packets to be transmitted before shutting down     */
119
      else if ( sig == SIGUSR1)
120
	  /* otherwise 2.0 drops unsent packets. fixme: find a better way than sleep */
120
        /* Dhcp release without Cache file deletion */
121
	  sleep(1);
121
        dhcpRelease(0);
122
	}
122
      /* allow time for final packets to be transmitted before shutting down     */
123
	syslog(LOG_ERR,"terminating on signal %d\n",sig);
123
      /* otherwise 2.0 drops unsent packets. fixme: find a better way than sleep */
124
      sleep(1);
125
      syslog(LOG_ERR,"terminating on signal %d\n",sig);
124
    }
126
    }
125
  dhcpStop();
127
  dhcpStop();
126
  deletePidFile();
128
  deletePidFile();

Return to bug 23428