1 Star 0 Fork 16

sys0613/dracut

forked from src-anolis-os/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0111.patch 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
From 8658cfd92b50197dd4f4d3b6d136950fe007ffc0 Mon Sep 17 00:00:00 2001
From: Frank Deng <frank.deng@oracle.com>
Date: Sat, 15 Jun 2019 13:35:42 -0700
Subject: [PATCH] 35network-legacy: fix classless static route parsing
(cherry picked from commit 11e1f680656177cfbba4e06f08b6707f4a812bc0)
Resolves: #1811042
---
modules.d/35network-legacy/dhclient-script.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh
index f1a60005..44633b30 100755
--- a/modules.d/35network-legacy/dhclient-script.sh
+++ b/modules.d/35network-legacy/dhclient-script.sh
@@ -126,9 +126,11 @@ parse_option_121() {
elif [ $mask -gt 8 ]; then
destination="$1.$2.0.0/$mask"
shift; shift
- else
+ elif [ $mask -gt 0 ]; then
destination="$1.0.0.0/$mask"
shift
+ else
+ destination="0.0.0.0/$mask"
fi
# Read the gateway
@@ -138,7 +140,7 @@ parse_option_121() {
# Multicast routing on Linux
# - If you set a next-hop address for a multicast group, this breaks with Cisco switches
# - If you simply leave it link-local and attach it to an interface, it works fine.
- if [ $multicast -eq 1 ]; then
+ if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then
temp_result="$destination dev $interface"
else
temp_result="$destination via $gateway dev $interface"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sys0613/dracut.git
git@gitee.com:sys0613/dracut.git
sys0613
dracut
dracut
a8

搜索帮助