1 Star 0 Fork 11

池鱼/dhcp

forked from src-anolis-os/dhcp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dhcp-dhclient-preinit6s.patch 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:30 . import dhcp-4.3.6-40.el8.src.rpm
diff -up dhcp-4.3.4/client/dhclient.c.preinit6s dhcp-4.3.4/client/dhclient.c
--- dhcp-4.3.4/client/dhclient.c.preinit6s 2016-04-29 13:15:10.361379493 +0200
+++ dhcp-4.3.4/client/dhclient.c 2016-04-29 13:17:43.622415423 +0200
@@ -812,6 +812,12 @@ main(int argc, char **argv) {
inaddr_any.s_addr = INADDR_ANY;
+ /* Discover all the network interfaces. */
+ discover_interfaces(DISCOVER_UNCONFIGURED);
+
+ /* Parse the dhclient.conf file. */
+ read_client_conf();
+
/* Stateless special case. */
if (stateless) {
if (release_mode || (wanted_ia_na > 0) ||
@@ -828,12 +834,6 @@ main(int argc, char **argv) {
return 0;
}
- /* Discover all the network interfaces. */
- discover_interfaces(DISCOVER_UNCONFIGURED);
-
- /* Parse the dhclient.conf file. */
- read_client_conf();
-
/* Parse any extra command line configuration arguments: */
if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) {
arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg);
@@ -1288,20 +1288,30 @@ void run_stateless(int exit_mode, u_int1
IGNORE_UNUSED(port);
#endif
- /* Discover the network interface. */
- discover_interfaces(DISCOVER_REQUESTED);
+ struct interface_info *ip;
if (!interfaces)
usage("No interfaces available for stateless command: %s", "-S");
- /* Parse the dhclient.conf file. */
#ifdef DHCP4o6
if (dhcpv4_over_dhcpv6) {
/* Mark we want to request IRT too! */
dhcpv4_over_dhcpv6++;
}
#endif
- read_client_conf();
+
+ for (ip = interfaces; ip; ip = ip->next) {
+ if ((interfaces_requested > 0) &&
+ ((ip->flags & (INTERFACE_REQUESTED |
+ INTERFACE_AUTOMATIC)) !=
+ INTERFACE_REQUESTED))
+ continue;
+ script_init(ip->client, "PREINIT6", NULL);
+ script_go(ip->client);
+ }
+
+ /* Discover the network interface. */
+ discover_interfaces(DISCOVER_REQUESTED);
/* Parse the lease database. */
read_client_leases();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxy19951122/dhcp.git
git@gitee.com:zxy19951122/dhcp.git
zxy19951122
dhcp
dhcp
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385