1 Star 0 Fork 8

zxk / rk-ethernet

forked from byxlk / rk-ethernet 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
获取不到ip,dhcp超时时间是30s,把超时时间增大到90s.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
poco.ye 提交于 2019-09-11 16:37 . add
commit 2d1de25c4bff1d60a17ae274a6d9fff154272446
Author: blb <blb@rock-chips.com>
Date: Mon Jun 1 11:04:00 2015 +0800
Increase dhcpcd's Timeout from 30s to 60s for dealing with terrible network.
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index e1df874..3b6f972 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -218,10 +218,10 @@ int dhcp_do_request(const char *interface,
/* Start the daemon and wait until it's ready */
if (property_get(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0'))
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s -h %s %s", DAEMON_NAME,
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s -h %s %s -t 60", DAEMON_NAME,
p2p_interface, DHCP_CONFIG_PATH, prop_value, interface);
else
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s %s", DAEMON_NAME,
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-f %s %s -t 60", DAEMON_NAME,
p2p_interface, DHCP_CONFIG_PATH, interface);
memset(prop_value, '\0', PROPERTY_VALUE_MAX);
property_set(ctrl_prop, daemon_cmd);
@@ -231,7 +231,7 @@ int dhcp_do_request(const char *interface,
}
/* Wait for the daemon to return a result */
- if (wait_for_property(result_prop_name, NULL, 30) < 0) {
+ if (wait_for_property(result_prop_name, NULL, 60) < 0) {
snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for DHCP to finish");
return -1;
}
@@ -355,13 +355,13 @@ int dhcp_do_request_renew(const char *interface,
property_set(result_prop_name, "");
/* Start the renew daemon and wait until it's ready */
- snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME_RENEW,
+ snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s -t 60", DAEMON_NAME_RENEW,
p2p_interface, interface);
memset(prop_value, '\0', PROPERTY_VALUE_MAX);
property_set(ctrl_prop, daemon_cmd);
/* Wait for the daemon to return a result */
- if (wait_for_property(result_prop_name, NULL, 30) < 0) {
+ if (wait_for_property(result_prop_name, NULL, 60) < 0) {
snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for DHCP Renew to finish");
return -1;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/feixuezhang/rk-ethernet.git
git@gitee.com:feixuezhang/rk-ethernet.git
feixuezhang
rk-ethernet
rk-ethernet
master

搜索帮助