From eff14060c1bf83909aa0903623b4470e47d28c3f Mon Sep 17 00:00:00 2001 From: whd <7058128+superwhd@users.noreply.github.com> Date: Tue, 20 Dec 2022 00:33:19 +0800 Subject: [PATCH] [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. --- tools/otci/otci/otci.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/otci/otci/otci.py b/tools/otci/otci/otci.py index ed000dd84..e66b4aa06 100644 --- a/tools/otci/otci/otci.py +++ b/tools/otci/otci/otci.py @@ -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