Fix: deal properly with tc qdisc show returning "noqueue"

This commit is contained in:
Rudi Chiarito
2016-01-02 23:51:53 -05:00
parent ac7f85046a
commit ea56e508f0
2 changed files with 19 additions and 3 deletions

View File

@@ -224,6 +224,12 @@ func (t *tcShaper) interfaceExists() (bool, string, error) {
if len(value) == 0 {
return false, "", nil
}
// Newer versions of tc and/or the kernel return the following instead of nothing:
// qdisc noqueue 0: root refcnt 2
fields := strings.Fields(value)
if len(fields) > 1 && fields[1] == "noqueue" {
return false, "", nil
}
return true, value, nil
}