Commit 35577d04 authored by Martín Ferrari's avatar Martín Ferrari

Adapt to changes in the tc command.

parent 69be7d3d
...@@ -688,7 +688,7 @@ def get_tc_tree(): ...@@ -688,7 +688,7 @@ def get_tc_tree():
if line == "": if line == "":
continue continue
match = re.match(r'qdisc (\S+) ([0-9a-f]+):[0-9a-f]* dev (\S+) ' + match = re.match(r'qdisc (\S+) ([0-9a-f]+):[0-9a-f]* dev (\S+) ' +
r'(?:parent ([0-9a-f]+):[0-9a-f]*|root)\s*(.*)', line) r'(?:parent ([0-9a-f]*):[0-9a-f]*|root)\s*(.*)', line)
if not match: if not match:
raise RuntimeError("Invalid output from `tc qdisc': `%s'" % line) raise RuntimeError("Invalid output from `tc qdisc': `%s'" % line)
qdisc = match.group(1) qdisc = match.group(1)
...@@ -696,11 +696,15 @@ def get_tc_tree(): ...@@ -696,11 +696,15 @@ def get_tc_tree():
iface = match.group(3) iface = match.group(3)
parent = match.group(4) # or None parent = match.group(4) # or None
extra = match.group(5) extra = match.group(5)
if parent == "":
# XXX: Still not sure what is this, shows in newer kernels for wlan
# interfaces.
continue
if iface not in data: if iface not in data:
data[iface] = {} data[iface] = {}
if parent not in data[iface]: if parent not in data[iface]:
data[iface][parent] = [] data[iface][parent] = []
data[iface][parent] += [[handle, qdisc, parent, extra]] data[iface][parent].append([handle, qdisc, parent, extra])
tree = {} tree = {}
for iface in data: for iface in data:
...@@ -789,7 +793,7 @@ def get_tc_data(): ...@@ -789,7 +793,7 @@ def get_tc_data():
continue continue
node = tree[ifdata[0][i].name] node = tree[ifdata[0][i].name]
if not node["children"]: if not node["children"]:
if node["qdisc"] == "mq" or node["qdisc"] == "pfifo_fast" \ if node["qdisc"] in ("mq", "pfifo_fast", "noqueue") \
or node["qdisc"][1:] == "fifo": or node["qdisc"][1:] == "fifo":
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment