Commit 330ae7e8 authored by Jondy Zhao's avatar Jondy Zhao

Fix different prefix name in windows 7 when getting ipv6 route table.

parent f8f4ffe4
...@@ -308,10 +308,11 @@ class TunnelManager(object): ...@@ -308,10 +308,11 @@ class TunnelManager(object):
routing_table = subprocess.check_output( routing_table = subprocess.check_output(
('netsh', 'interface', 'ipv6', 'show', 'route', 'verbose'), ('netsh', 'interface', 'ipv6', 'show', 'route', 'verbose'),
stderr=subprocess.OUTPUT) stderr=subprocess.OUTPUT)
pname = 'Prefix' if platform.system()[10:11] == '5' else 'Destination Prefix'
for line in routing_table.splitlines(): for line in routing_table.splitlines():
fs = line.split(':', 1) fs = line.split(':', 1)
test = fs[0].startswith test = fs[0].startswith
if test('Prefix'): if test(pname):
prefix, prefix_len = fs[1].split('/', 1) prefix, prefix_len = fs[1].split('/', 1)
elif test('Interface'): elif test('Interface'):
yield (fs[1].strip(), yield (fs[1].strip(),
......
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