[otci] fix parsing route flags (#8537)

A route in network data's output may have more than one flag. For
example, a NAT64 route can have `sn` as its flags. The previous
`__parse_routes` would crash when processing such a route.
This commit is contained in:
whd
2022-12-19 08:33:19 -08:00
committed by GitHub
parent 117c8519ec
commit eff14060c1
+3 -3
View File
@@ -1622,9 +1622,9 @@ class OTCI(object):
routes = []
for line in output:
line = line.split()
if line[1] == 's':
prefix, _, prf, rloc16 = line
stable = True
if len(line) == 4:
prefix, flags, prf, rloc16 = line
stable = 's' in flags
else:
prefix, prf, rloc16 = line
stable = False