Browse Source

Make udhcpc send DHCP DISCOVER messages more frequently

This should help reduce the impact of links that are slow to become usable
(eg #414117), and improve the effectiveness of preseeded increases in
dhcp_timeout, although the problem isn't really solved, so the bug can't be
closed just yet.

Thanks to Ferenc Wagner for the patch.

r66208
tags/1.60
Matthew Palmer 10 years ago
parent
commit
393d7e2ec0
2 changed files with 17 additions and 2 deletions
  1. +9
    -0
      debian/changelog
  2. +8
    -2
      dhcp.c

+ 9
- 0
debian/changelog View File

@@ -1,3 +1,12 @@
netcfg (1.60) UNRELEASED; urgency=low

* Increase the frequency of DHCP discover packets sent during DHCP
configuration using udhcpc. This should ameliorate some problems with
DHCP configuration when a link is slow to become available.
Thanks to Ferenc Wagner for the patch.

-- Matt Palmer <mpalmer@debian.org> Sat, 08 Jan 2011 10:33:35 +1100

netcfg (1.59) unstable; urgency=low

[ Matt Palmer ]


+ 8
- 2
dhcp.c View File

@@ -138,6 +138,7 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)
int options_count;
enum { DHCLIENT, PUMP, UDHCPC } dhcp_client;
int dhcp_seconds;
char dhcp_seconds_str[16];

if (access("/sbin/dhclient", F_OK) == 0)
dhcp_client = DHCLIENT;
@@ -153,6 +154,7 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)

debconf_get(client, "netcfg/dhcp_timeout");
dhcp_seconds = atoi(client->value);
snprintf(dhcp_seconds_str, sizeof dhcp_seconds_str, "%d", dhcp_seconds-1);

if ((dhcp_pid = fork()) == 0) { /* child */
/* disassociate from debconf */
@@ -202,10 +204,10 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)

/* Allow space for:
options: options_count * 2
params: 5
params: 9
hostname: 2
NULL: 1 */
arguments = malloc((options_count * 2 + 5 + 2 + 1) * sizeof(char **));
arguments = malloc((options_count * 2 + 9 + 2 + 1) * sizeof(char **));

/* set the command options */
options_count = 0;
@@ -214,6 +216,10 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)
arguments[options_count++] = interface;
arguments[options_count++] = "-V";
arguments[options_count++] = "d-i";
arguments[options_count++] = "-T";
arguments[options_count++] = "1";
arguments[options_count++] = "-t";
arguments[options_count++] = dhcp_seconds_str;
for (ptr = dhclient_request_options_udhcpc; *ptr; ptr++) {
arguments[options_count++] = "-O";
arguments[options_count++] = *ptr;


Loading…
Cancel
Save