2 # SPDX-License-Identifier: GPL-2.0
6 wait_local_port_listen
()
8 local listener_ns
="${1}"
14 pattern
=":$(printf "%04X
" "${port}") "
16 # for tcp protocol additionally check the socket state
17 [ ${protocol} = "tcp" ] && pattern
="${pattern}0A"
18 for i
in $
(seq 10); do
19 if ip netns
exec "${listener_ns}" awk '{print $2" "$4}' \
20 /proc
/net
/"${protocol}"* |
grep -q "${pattern}"; then