Unix Technical Forum

Re: dhcpclient diff (new options)

This is a discussion on Re: dhcpclient diff (new options) within the lucky.openbsd.tech forums, part of the OpenBSD category; --> ahoi, after theo's update/cleanup of the keyword lookup in the lexer of dhclient, an updated diff to add the ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 12:21 PM
Felix Kronlage
 
Posts: n/a
Default Re: dhcpclient diff (new options)

ahoi,

after theo's update/cleanup of the keyword lookup in the lexer of
dhclient, an updated diff to add the option 'link-timeout n' to
dhclient.conf in order to specify how long dhclient should try
an interface that has no link.

felix

Index: sbin/dhclient//clparse.c
================================================== =================
RCS file: /src/src/sbin/dhclient/clparse.c,v
retrieving revision 1.27
diff -u -r1.27 clparse.c
--- sbin/dhclient//clparse.c 18 Apr 2006 19:17:54 -0000 1.27
+++ sbin/dhclient//clparse.c 19 Apr 2006 20:23:35 -0000
@@ -64,6 +64,7 @@
new_parse(path_dhclient_conf);

/* Set some defaults... */
+ config->link_timeout = 10;
config->timeout = 60;
config->select_interval = 0;
config->reboot_timeout = 10;
@@ -144,6 +145,7 @@
* hardware-declaration |
* REQUEST option-list |
* REQUIRE option-list |
+ * LINK_TIMEOUT number |
* TIMEOUT number |
* RETRY number |
* REBOOT number |
@@ -198,6 +200,9 @@
memset(config->required_options, 0,
sizeof(config->required_options));
parse_option_list(cfile, config->required_options);
+ return;
+ case TOK_LINK_TIMEOUT:
+ parse_lease_time(cfile, &config->link_timeout);
return;
case TOK_TIMEOUT:
parse_lease_time(cfile, &config->timeout);
Index: sbin/dhclient//conflex.c
================================================== =================
RCS file: /src/src/sbin/dhclient/conflex.c,v
retrieving revision 1.11
diff -u -r1.11 conflex.c
--- sbin/dhclient//conflex.c 18 Apr 2006 19:17:54 -0000 1.11
+++ sbin/dhclient//conflex.c 20 Apr 2006 13:39:23 -0000
@@ -327,6 +327,7 @@
{ "initial-interval", TOK_INITIAL_INTERVAL },
{ "interface", TOK_INTERFACE },
{ "lease", TOK_LEASE },
+ { "link-timeout", TOK_LINK_TIMEOUT },
{ "media", TOK_MEDIA },
{ "medium", TOK_MEDIUM },
{ "option", TOK_OPTION },
Index: sbin/dhclient//dhclient.c
================================================== =================
RCS file: /src/src/sbin/dhclient/dhclient.c,v
retrieving revision 1.82
diff -u -r1.82 dhclient.c
--- sbin/dhclient//dhclient.c 6 Mar 2006 10:45:56 -0000 1.82
+++ sbin/dhclient//dhclient.c 19 Apr 2006 20:15:49 -0000
@@ -315,7 +315,7 @@
while (!interface_link_status(ifi->name)) {
fprintf(stderr, ".");
fflush(stderr);
- if (++i > 10) {
+ if (++i > ifi->client->config->link_timeout) {
fprintf(stderr, " giving up\n");
exit(1);
}
Index: sbin/dhclient//dhclient.conf.5
================================================== =================
RCS file: /src/src/sbin/dhclient/dhclient.conf.5,v
retrieving revision 1.6
diff -u -r1.6 dhclient.conf.5
--- sbin/dhclient//dhclient.conf.5 30 Sep 2005 20:34:23 -0000 1.6
+++ sbin/dhclient//dhclient.conf.5 19 Apr 2006 20:15:50 -0000
@@ -154,6 +154,12 @@
If it is greater than the backoff-cutoff amount, it is set to that
amount.
It defaults to ten seconds.
+.It Ic link-timeout Ar time ;
+The
+.Ic link-timeout
+statement sets the amount of time too wait for an interface link before timing
+out. Theres a default value of 10 and the special value 0 says that dhclient
+should not wait for a link state change before timing out.
.El
.Sh LEASE REQUIREMENTS AND REQUESTS
The DHCP protocol allows the client to request that the server send it
Index: sbin/dhclient//dhcpd.h
================================================== =================
RCS file: /src/src/sbin/dhclient/dhcpd.h,v
retrieving revision 1.47
diff -u -r1.47 dhcpd.h
--- sbin/dhclient//dhcpd.h 5 Aug 2005 16:23:30 -0000 1.47
+++ sbin/dhclient//dhcpd.h 19 Apr 2006 20:15:50 -0000
@@ -156,6 +156,7 @@
int requested_option_count;
time_t timeout;
time_t initial_interval;
+ time_t link_timeout;
time_t retry_interval;
time_t select_interval;
time_t reboot_timeout;
Index: sbin/dhclient//dhctoken.h
================================================== =================
RCS file: /src/src/sbin/dhclient/dhctoken.h,v
retrieving revision 1.3
diff -u -r1.3 dhctoken.h
--- sbin/dhclient//dhctoken.h 18 Apr 2006 19:17:54 -0000 1.3
+++ sbin/dhclient//dhctoken.h 20 Apr 2006 13:20:03 -0000
@@ -78,6 +78,7 @@
#define TOK_PREPEND 291
#define TOK_REJECT 292
#define TOK_FDDI 293
+#define TOK_LINK_TIMEOUT 294

#define is_identifier(x) ((x) >= TOK_FIRST_TOKEN && \
(x) != TOK_STRING && \

--
GPG/PGP: D9AC74D0 / 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0
http://hazardous.org/~fkr - fkr@hazardous.org - fkr@silc|irc - FKR-RIPE
https://www.bytemine.net/ - bytemine - BSD based hosting/solutions/ideas

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:14 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com