From e681002d186018311994918a712ff2ddf3516b06 Mon Sep 17 00:00:00 2001 From: Alexander Staubo Date: Wed, 6 Jul 2016 23:15:51 -0400 Subject: [PATCH] Fixes bad heuristic when calling "tc show" to check interface; tc sometimes returns stuff that has more than 12 words in its response. The heuristic is bad, but this at least fixes the case when tc is returning too much. --- pkg/util/bandwidth/linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/bandwidth/linux.go b/pkg/util/bandwidth/linux.go index ab68141d623..13d6a7e58e0 100644 --- a/pkg/util/bandwidth/linux.go +++ b/pkg/util/bandwidth/linux.go @@ -255,7 +255,7 @@ func (t *tcShaper) ReconcileInterface() error { return t.initializeInterface() } fields := strings.Split(output, " ") - if len(fields) != 12 || fields[1] != "htb" || fields[2] != "1:" { + if len(fields) < 12 || fields[1] != "htb" || fields[2] != "1:" { if err := t.deleteInterface(fields[2]); err != nil { return err }