Skip to content

Commit

Permalink
Revert "[route_check] fix IPv6 address handling (sonic-net#2722)"
Browse files Browse the repository at this point in the history
This reverts commit ff68832.
  • Loading branch information
StormLiangMS committed Mar 28, 2023
1 parent 4dcd582 commit 4db753c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
5 changes: 2 additions & 3 deletions scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import traceback
import subprocess

from ipaddress import ip_network
from swsscommon import swsscommon
from utilities_common import chassis

Expand Down Expand Up @@ -146,7 +145,7 @@ def add_prefix(ip):
ip = ip + PREFIX_SEPARATOR + "32"
else:
ip = ip + PREFIX_SEPARATOR + "128"
return str(ip_network(ip))
return ip


def add_prefix_ifnot(ip):
Expand All @@ -155,7 +154,7 @@ def add_prefix_ifnot(ip):
:param ip: IP to add prefix as string.
:return ip with prefix
"""
return str(ip_network(ip)) if ip.find(PREFIX_SEPARATOR) != -1 else add_prefix(ip)
return ip if ip.find(PREFIX_SEPARATOR) != -1 else add_prefix(ip)


def is_local(ip):
Expand Down
18 changes: 0 additions & 18 deletions tests/route_check_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,22 +462,4 @@
},
RET: -1,
},
"10": {
DESCR: "basic good one with IPv6 address",
ARGS: "route_check -m INFO -i 1000",
PRE: {
APPL_DB: {
ROUTE_TABLE: {
},
INTF_TABLE: {
"PortChannel1013:2000:31:0:0::1/64": {},
}
},
ASIC_DB: {
RT_ENTRY_TABLE: {
RT_ENTRY_KEY_PREFIX + "2000:31::1/128" + RT_ENTRY_KEY_SUFFIX: {},
}
}
}
},
}

0 comments on commit 4db753c

Please sign in to comment.