加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-net-dns-Fix-removal-of-DNS-server.patch 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2023-08-17 19:15 . backport some patches from upstream
From f301a9356b6338e983eae38debe69bbd3a417b1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Fri, 28 Apr 2023 13:05:37 +0200
Subject: net/dns: Fix removal of DNS server
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When deleting the DNS server, we get the following error message:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> net_del_dns 192.168.122.1
error: ../../grub-core/net/dns.c:646:no DNS reply received.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
This happens because the implementation is broken, it does a "add"
internally instead of a "delete".
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit?id=f301a9356b6338e983eae38debe69bbd3a417b1a
Conflict:NA
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/net/dns.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c
index afa3894..e51682d 100644
--- a/grub-core/net/dns.c
+++ b/grub-core/net/dns.c
@@ -765,11 +765,14 @@ grub_cmd_del_dns (struct grub_command *cmd __attribute__ ((unused)),
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
- err = grub_net_resolve_address (args[1], &server);
+
+ err = grub_net_resolve_address (args[0], &server);
if (err)
return err;
- return grub_net_add_dns_server (&server);
+ grub_net_remove_dns_server (&server);
+
+ return GRUB_ERR_NONE;
}
static grub_command_t cmd, cmd_add, cmd_del, cmd_list;
--
cgit v1.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化