Skip to content

Commit 4db753c

Browse files
committed
Revert "[route_check] fix IPv6 address handling (sonic-net#2722)"
This reverts commit ff68832.
1 parent 4dcd582 commit 4db753c

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

scripts/route_check.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import traceback
4848
import subprocess
4949

50-
from ipaddress import ip_network
5150
from swsscommon import swsscommon
5251
from utilities_common import chassis
5352

@@ -146,7 +145,7 @@ def add_prefix(ip):
146145
ip = ip + PREFIX_SEPARATOR + "32"
147146
else:
148147
ip = ip + PREFIX_SEPARATOR + "128"
149-
return str(ip_network(ip))
148+
return ip
150149

151150

152151
def add_prefix_ifnot(ip):
@@ -155,7 +154,7 @@ def add_prefix_ifnot(ip):
155154
:param ip: IP to add prefix as string.
156155
:return ip with prefix
157156
"""
158-
return str(ip_network(ip)) if ip.find(PREFIX_SEPARATOR) != -1 else add_prefix(ip)
157+
return ip if ip.find(PREFIX_SEPARATOR) != -1 else add_prefix(ip)
159158

160159

161160
def is_local(ip):

tests/route_check_test_data.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -462,22 +462,4 @@
462462
},
463463
RET: -1,
464464
},
465-
"10": {
466-
DESCR: "basic good one with IPv6 address",
467-
ARGS: "route_check -m INFO -i 1000",
468-
PRE: {
469-
APPL_DB: {
470-
ROUTE_TABLE: {
471-
},
472-
INTF_TABLE: {
473-
"PortChannel1013:2000:31:0:0::1/64": {},
474-
}
475-
},
476-
ASIC_DB: {
477-
RT_ENTRY_TABLE: {
478-
RT_ENTRY_KEY_PREFIX + "2000:31::1/128" + RT_ENTRY_KEY_SUFFIX: {},
479-
}
480-
}
481-
}
482-
},
483465
}

0 commit comments

Comments
 (0)