1 Star 0 Fork 94

Mingtai/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-resolve-synthesize-null-address-IPv4-broadcast-addre.patch 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
From a3d2c2b669149fe7e1bfdfa0c72c39653bef2e4c Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Mon, 24 Jan 2022 06:36:53 +0900
Subject: [PATCH] resolve: synthesize null address, IPv4 broadcast address, or
invalid domain
These are filtered in `dns_scope_good_domain()`, but not synthesized.
Fixes #22229.
(cherry picked from commit 46b53e8035fb60c9a7f26dd32d6689ab3b7da97c)
(cherry picked from commit 89b439ee00e3fbee47cda3f790cbf320538cae7f)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/a3d2c2b669149fe7e1bfdfa0c72c39653bef2e4c
---
src/resolve/resolved-dns-synthesize.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/resolve/resolved-dns-synthesize.c b/src/resolve/resolved-dns-synthesize.c
index ea239e686d..0914515fdf 100644
--- a/src/resolve/resolved-dns-synthesize.c
+++ b/src/resolve/resolved-dns-synthesize.c
@@ -397,6 +397,14 @@ int dns_synthesize_answer(
if (dns_name_is_empty(name)) {
/* Do nothing. */
+ } else if (dns_name_endswith(name, "0.in-addr.arpa") > 0 ||
+ dns_name_equal(name, "255.255.255.255.in-addr.arpa") > 0 ||
+ dns_name_equal(name, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa") > 0 ||
+ dns_name_endswith(name, "invalid") > 0) {
+
+ nxdomain = true;
+ continue;
+
} else if (is_localhost(name)) {
r = synthesize_localhost_rr(m, key, ifindex, &answer);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd.git
git@gitee.com:yangmingtaip/systemd.git
yangmingtaip
systemd
systemd
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385