dracut/0027.patch
Pavel Valena a5ba84ec9e dracut-057-38.git20230725
Resolves: #1933787,#2180787,#2181541
2023-07-25 13:34:23 +02:00

66 lines
2.0 KiB
Diff

From 0322e328d94f70693e1e33fb96bd5d9d771fea3a Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Fri, 16 Sep 2022 23:46:42 +0200
Subject: [PATCH] fix(nvmf): don't try to validate network connections in
cmdline hook
The cmdline hook runs before any network interfaces have been brought
up. There's no point in trying to validate the connections at this
stage.
Resolves: #1933787
---
modules.d/95nvmf/parse-nvmf-boot-connections.sh | 31 -------------------------
1 file changed, 31 deletions(-)
diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
index 46c00636..39923503 100755
--- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh
+++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
@@ -26,34 +26,6 @@ fi
initqueue --onetime modprobe --all -b -q nvme nvme_tcp nvme_core nvme_fabrics
-validate_ip_conn() {
- if ! getargbool 0 rd.neednet; then
- warn "$trtype transport requires rd.neednet=1"
- return 1
- fi
-
- local_address=$(ip -o route get to "$traddr" | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
-
- # confirm we got a local IP address
- if ! is_ip "$local_address"; then
- warn "$traddr is an invalid address"
- return 1
- fi
-
- ifname=$(ip -o route get from "$local_address" to "$traddr" | sed -n 's/.*dev \([^ ]*\).*/\1/p')
-
- if ! ip l show "$ifname" > /dev/null 2>&1; then
- warn "invalid network interface $ifname"
- return 1
- fi
-
- # confirm there's a route to destination
- if ! ip route get "$traddr" > /dev/null 2>&1; then
- warn "no route to $traddr"
- return 1
- fi
-}
-
parse_nvmf_discover() {
traddr="none"
trtype="none"
@@ -103,9 +75,6 @@ parse_nvmf_discover() {
warn "unsupported transport $trtype"
return 0
fi
- if [ "$trtype" = "tcp" ]; then
- validate_ip_conn
- fi
if [ "$trtype" = "fc" ]; then
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr" >> /etc/nvme/discovery.conf
else