From: Martin Wilck Date: Fri, 16 Sep 2022 21:46:42 +0000 (+0200) Subject: fix(nvmf): don't try to validate network connections in cmdline hook X-Git-Tag: 058~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3ff3f3fbce6878a754332cd4a05374e5e1156c8;p=thirdparty%2Fdracut.git 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. --- diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh index 46c006369..399235034 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