You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mirroring] Incorrect validation of new mirror session's source and destination interface with old mirror session's source and destination interfaces.
#16604
Open
hari-selvam opened this issue
Sep 20, 2023
· 1 comment
If a new span/erspan mirror session is created with (a) source port(s) as same as the first digit of old mirror session's source port list, errors out "Source Interface already has mirror config in same direction".
If a new span mirror session is created with a destination port as same as the first digit of old mirror session's source port list, errors out "Destination Interface {} already has mirror config".
interface_has_mirror_config breaks the source_port_list and checks the each port in the list with old sessions' source_port_list by using re.search(). But this check returns true even if the old session's source_port_list's port-name is prefix of the new session's source_port's name. For example, suppose 'Ethernet4' is the source port of old session and 'Ethernet44,Ethernet50' is the new session's source port list and the above check returns true for both 'Ethernet4' and 'Ethernet44'.
create an another mirror session with the destination port same as the first digit of source port created in old mirror session
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
case2: config mirror_session span add test4 Ethernet56 Ethernet104,Ethernet108 rx
Describe the results you received:
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
Error: Source Interface Ethernet44 already has mirror config in same direction
New session configs should be accepted without any errors, since test3 session's src-port Ethernet44 is not same as test3 session's dst-port Ethernet4 and test4 session's dst-port Ethernet56 is not as same as test2 session's src-port Ethernet52 .
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
case2: config mirror_session span add test4 Ethernet56 Ethernet104,Ethernet108 rx
Output of show version:
root@sonic:~# show version
SONiC Software Version: SONiC.CLS_SONiC_202205_2-0-0_27
Distribution: Debian 11.7
Kernel: 5.10.0-18-2-amd64
Build commit: c81dcff11
Build date: Wed Aug 23 12:10:26 UTC 2023
Built by: autobuild@AZUHPSP10
Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered:
hari-selvam
changed the title
[mirroring] Incorrect validation of new mirror session's source and destination interface with the existing mirror session's source and destination interfaces.
[mirroring] Incorrect validation of new mirror session's source and destination interface with old mirror session's source and destination interfaces.
Sep 20, 2023
Description
interface_has_mirror_config breaks the source_port_list and checks the each port in the list with old sessions' source_port_list by using re.search(). But this check returns true even if the old session's source_port_list's port-name is prefix of the new session's source_port's name. For example, suppose 'Ethernet4' is the source port of old session and 'Ethernet44,Ethernet50' is the new session's source port list and the above check returns true for both 'Ethernet4' and 'Ethernet44'.
Steps to reproduce the issue:
create a mirror session
case1: config mirror_session span add test1 Ethernet20 Ethernet4 rx
case2: config mirror_session span add test2 Ethernet96 Ethernet52 rx
create an another mirror session with the destination port same as the first digit of source port created in old mirror session
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
case2: config mirror_session span add test4 Ethernet56 Ethernet104,Ethernet108 rx
Describe the results you received:
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
Error: Source Interface Ethernet44 already has mirror config in same direction
case2: config mirror_session span add test4 Ethernet56 Ethernet104,Ethernet108 rx
Error: Destination Interface Ethernet56 already has mirror config
Describe the results you expected:
New session configs should be accepted without any errors, since test3 session's src-port Ethernet44 is not same as test3 session's dst-port Ethernet4 and test4 session's dst-port Ethernet56 is not as same as test2 session's src-port Ethernet52 .
case1: config mirror_session span add test3 Ethernet0 Ethernet44,Ethernet48 rx
case2: config mirror_session span add test4 Ethernet56 Ethernet104,Ethernet108 rx
Output of
show version
:root@sonic:~# show version
SONiC Software Version: SONiC.CLS_SONiC_202205_2-0-0_27
Distribution: Debian 11.7
Kernel: 5.10.0-18-2-amd64
Build commit: c81dcff11
Build date: Wed Aug 23 12:10:26 UTC 2023
Built by: autobuild@AZUHPSP10
Platform: x86_64-cel_belgite-r0
HwSKU: CELESTICA-BELGITE
ASIC: broadcom
ASIC Count: 1
Serial Number: E1070F2B042525GD200122
Model Number: R3059-F9010-01
Hardware Revision: 4
Uptime: 07:31:14 up 7 days, 19:57, 2 users, load average: 0.33, 0.37, 0.42
Date: Wed 20 Sep 2023 07:31:14
Output of
show techsupport
:N/A as problem is fully diagnosed.
Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: