Skip to content

Commit b3ff3f3

Browse files
mwilckjohannbg
authored andcommitted
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.
1 parent 9664e98 commit b3ff3f3

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

modules.d/95nvmf/parse-nvmf-boot-connections.sh

-31
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,6 @@ fi
2626

2727
initqueue --onetime modprobe --all -b -q nvme nvme_tcp nvme_core nvme_fabrics
2828

29-
validate_ip_conn() {
30-
if ! getargbool 0 rd.neednet; then
31-
warn "$trtype transport requires rd.neednet=1"
32-
return 1
33-
fi
34-
35-
local_address=$(ip -o route get to "$traddr" | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
36-
37-
# confirm we got a local IP address
38-
if ! is_ip "$local_address"; then
39-
warn "$traddr is an invalid address"
40-
return 1
41-
fi
42-
43-
ifname=$(ip -o route get from "$local_address" to "$traddr" | sed -n 's/.*dev \([^ ]*\).*/\1/p')
44-
45-
if ! ip l show "$ifname" > /dev/null 2>&1; then
46-
warn "invalid network interface $ifname"
47-
return 1
48-
fi
49-
50-
# confirm there's a route to destination
51-
if ! ip route get "$traddr" > /dev/null 2>&1; then
52-
warn "no route to $traddr"
53-
return 1
54-
fi
55-
}
56-
5729
parse_nvmf_discover() {
5830
traddr="none"
5931
trtype="none"
@@ -103,9 +75,6 @@ parse_nvmf_discover() {
10375
warn "unsupported transport $trtype"
10476
return 0
10577
fi
106-
if [ "$trtype" = "tcp" ]; then
107-
validate_ip_conn
108-
fi
10978
if [ "$trtype" = "fc" ]; then
11079
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr" >> /etc/nvme/discovery.conf
11180
else

0 commit comments

Comments
 (0)