Репозитории ALT
S: | 4.4.3.P1-alt1 |
5.1: | 3.0.7-alt4 |
4.1: | 3.0.6-alt2.M41.1 |
4.0: | 3.0.6-alt1 |
3.0: | 3.0.2-alt1 |
Группа :: Система/Серверы
Пакет: dhcp
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: 0027-dhclient-rename-timeout-option-to-timeout.patch
Скачать
Скачать
From 0 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov <sem@altlinux.org>
Date: Wed, 30 Aug 2017 17:53:50 +0300
Subject: [PATCH 27] dhclient: rename -timeout option to --timeout
According to what Fedora did. But keep -timeout support for
backward compatibility.
diff --git a/dhcp/client/dhclient.8 b/dhcp/client/dhclient.8
index defaced..defaced 100644
--- a/dhcp/client/dhclient.8
+++ b/dhcp/client/dhclient.8
@@ -164,7 +164,7 @@ dhclient - Dynamic Host Configuration Protocol Client
.I request-option-list
]
[
-.B -timeout
+.B --timeout
.I timeout
]
[
@@ -394,7 +394,7 @@ specify all option names for the
parameter.
.TP
-.BI \-timeout\ <timeout>
+.BI \--timeout,\ \-timeout\ <timeout>
Specify the time after which
.B dhclient
will decide that no DHCP servers can be contacted when no responses have been
diff --git a/dhcp/client/dhclient.c b/dhcp/client/dhclient.c
index defaced..defaced 100644
--- a/dhcp/client/dhclient.c
+++ b/dhcp/client/dhclient.c
@@ -202,7 +202,7 @@ static const char use_v6command[] = "Command not used for DHCPv4: %s";
" [-df duid-file] [-lf lease-file]\n" \
" [-pf pid-file] [--no-pid] [-e VAR=val]\n" \
" [-C <dhcp-client-identifier>] [-B]\n" \
-" [-H <host-name> | -F <fqdn.fqdn>] [-timeout <timeout>]\n" \
+" [-H <host-name> | -F <fqdn.fqdn>] [--timeout <timeout>]\n" \
" [-V <vendor-class-identifier>]\n" \
" [--request-options <request option list>]\n" \
" [-sf script-file] [interface]*"
@@ -646,7 +646,7 @@ main(int argc, char **argv) {
}
dhcp_fqdn_arg = argv[i];
- } else if (!strcmp(argv[i], "-timeout")) {
+ } else if (!strcmp(argv[i], "--timeout") || !strcmp(argv[i], "-timeout")) {
if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) {
usage(use_noarg, argv[i-1]);
exit(1);
@@ -937,14 +937,14 @@ main(int argc, char **argv) {
arg_conf_len = asprintf(&arg_conf, "timeout %d;", timeout_arg);
if ((arg_conf == 0) || (arg_conf_len <= 0))
- log_fatal("Unable to process -timeout timeout argument");
+ log_fatal("Unable to process --timeout timeout argument");
} else {
char *last_arg_conf = arg_conf;
arg_conf = NULL;
arg_conf_len = asprintf(&arg_conf, "%s\ntimeout %d;", last_arg_conf, timeout_arg);
if ((arg_conf == 0) || (arg_conf_len == 0))
- log_fatal("Unable to process -timeout timeout argument");
+ log_fatal("Unable to process --timeout timeout argument");
free(last_arg_conf);
}
@@ -990,7 +990,7 @@ main(int argc, char **argv) {
if (arg_conf_len == 0)
if ((arg_conf_len = strlen(arg_conf)) == 0)
/* huh ? cannot happen ! */
- log_fatal("Unable to process -C/-H/-F/-timeout/-V/--request-options configuration arguments");
+ log_fatal("Unable to process -C/-H/-F/--timeout/-V/--request-options configuration arguments");
/* parse the extra dhclient.conf configuration arguments
* into top level config: */
@@ -998,10 +998,10 @@ main(int argc, char **argv) {
const char *val = NULL;
int token;
- status = new_parse(&cfile, -1, arg_conf, arg_conf_len, "extra dhclient -C/-H/-F/-timeout/-V/--request-options configuration arguments", 0);
+ status = new_parse(&cfile, -1, arg_conf, arg_conf_len, "extra dhclient -C/-H/-F/--timeout/-V/--request-options configuration arguments", 0);
if ((status != ISC_R_SUCCESS) || (cfile -> warnings_occurred))
- log_fatal("Cannot parse -C/-H/-F/-timeout/-V/--request-options configuration arguments !");
+ log_fatal("Cannot parse -C/-H/-F/--timeout/-V/--request-options configuration arguments !");
/* more detailed parse failures will be logged */
do {
@@ -1013,7 +1013,7 @@ main(int argc, char **argv) {
} while (1);
if (cfile -> warnings_occurred)
- log_fatal("Cannot parse -C/-H/-F/-timeout/-V/--request-options configuration arguments !");
+ log_fatal("Cannot parse -C/-H/-F/--timeout/-V/--request-options configuration arguments !");
end_parse(&cfile);
if (timeout_arg) {