Browse Source

dhcp: drop dhcp3 compatibility since isc-dhcp looks exactly as regular dhclient.

r63572
tags/1.53
Otavio Salvador 11 years ago
parent
commit
2e4a625cbe
4 changed files with 5 additions and 34 deletions
  1. +2
    -0
      debian/changelog
  2. +2
    -32
      dhcp.c
  3. +1
    -1
      netcfg-common.c
  4. +0
    -1
      netcfg.h

+ 2
- 0
debian/changelog View File

@@ -14,6 +14,8 @@ netcfg (1.53) UNRELEASED; urgency=low
[ Otavio Salvador ]
* kfreebsd-{amd64,i386}: depends on isc-client-udeb (as it replaces
the dhcp3-client-udeb).
* dhcp: drop dhcp3 compatibility since isc-dhcp looks exactly as
regular dhclient.

-- Frans Pop <fjp@debian.org> Thu, 08 Apr 2010 00:32:48 +0200



+ 2
- 32
dhcp.c View File

@@ -127,14 +127,11 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)
const char **ptr;
char **arguments;
int options_count;
enum { DHCLIENT, DHCLIENT3, PUMP, UDHCPC } dhcp_client;
enum { DHCLIENT, PUMP, UDHCPC } dhcp_client;
int dhcp_seconds;

if (access("/sbin/dhclient", F_OK) == 0)
if (access("/var/lib/dhcp3", F_OK) == 0)
dhcp_client = DHCLIENT3;
else
dhcp_client = DHCLIENT;
dhcp_client = DHCLIENT;
else if (access("/sbin/pump", F_OK) == 0)
dhcp_client = PUMP;
else if (access("/sbin/udhcpc", F_OK) == 0)
@@ -165,33 +162,6 @@ int start_dhcp_client (struct debconfclient *client, char* dhostname)
case DHCLIENT:
/* First, set up dhclient.conf */
if ((dc = file_open(DHCLIENT_CONF, "w"))) {
fprintf(dc, "send dhcp-class-identifier \"d-i\";\n");
fprintf(dc, "request ");

for (ptr = dhclient_request_options_dhclient; *ptr; ptr++) {
fprintf(dc, *ptr);

/* look ahead to see if it is the last entry */
if (*(ptr + 1))
fprintf(dc, ", ");
else
fprintf(dc, ";\n");
}

if (dhostname) {
fprintf(dc, "send host-name \"%s\";\n", dhostname);
}
fprintf(dc, "timeout %d;\n", dhcp_seconds);
fclose(dc);
}

execlp("dhclient", "dhclient", "-e", interface, NULL);
break;

case DHCLIENT3:
/* Different place.. */

if ((dc = file_open(DHCLIENT3_CONF, "w"))) {
fprintf(dc, "send vendor-class-identifier \"d-i\";\n" );
fprintf(dc, "request ");



+ 1
- 1
netcfg-common.c View File

@@ -858,7 +858,7 @@ void reap_old_files (void)
{
static char* remove[] =
{ INTERFACES_FILE, HOSTS_FILE, HOSTNAME_FILE, NETWORKS_FILE,
RESOLV_FILE, DHCLIENT_CONF, DHCLIENT3_CONF, DOMAIN_FILE, 0 };
RESOLV_FILE, DHCLIENT_CONF, DOMAIN_FILE, 0 };
char **ptr = remove;

while (*ptr)


+ 0
- 1
netcfg.h View File

@@ -7,7 +7,6 @@
#define NETWORKS_FILE "/etc/networks"
#define RESOLV_FILE "/etc/resolv.conf"
#define DHCLIENT_CONF "/etc/dhclient.conf"
#define DHCLIENT3_CONF "/etc/dhcp3/dhclient.conf"
#define DOMAIN_FILE "/tmp/domain_name"
#define NTP_SERVER_FILE "/tmp/dhcp-ntp-servers"



Loading…
Cancel
Save