From b493cf260439d7572abba4500f2f3deda96a0067 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Thu, 17 Mar 2022 20:09:29 +0100 Subject: [PATCH] Fix iface stats check, impl. cake SQM detection --- lagdetect.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lagdetect.sh b/lagdetect.sh index bca7ffa..1e0936e 100755 --- a/lagdetect.sh +++ b/lagdetect.sh @@ -158,7 +158,7 @@ done for i in "${IFACE_RX}" "${IFACE_TX}" do - if ip link show "${i}" >/dev/null + if ! ip link show "${i}" >/dev/null then printf 'FATAL: Interface "%s" seems bogus\n' "${i}" exit 1 @@ -166,6 +166,18 @@ do done +# XXX TODO add TX once/if egress SQM mgmt is implemented +for i in "${IFACE_RX}" +do + _qd="$(tc qdisc show dev "${i}" | awk '/^qdisc/{print $2}')" + if ! [ x"${_qd}" = xcake ] + then + printf 'FATAL: Interface "%s" does not seem to have cake SQM set up\n' "${i}" + exit 1 + fi +done + + set -u -- 2.39.5