Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swss stretch update broke restore_neighbors.py for neigh service #2735

Closed
jipanyang opened this issue Apr 3, 2019 · 2 comments · Fixed by #2745
Closed

swss stretch update broke restore_neighbors.py for neigh service #2735

jipanyang opened this issue Apr 3, 2019 · 2 comments · Fixed by #2745

Comments

@jipanyang
Copy link
Collaborator

jipanyang commented Apr 3, 2019

Description
Not seen with old version of swss docker.

With new swss docker, read_routes6() of linux.py for scapy translate ipv6 address 2000:0:0:100::1 into invalid format of 2000::100::1

Steps to reproduce the issue:
1.
root@ASW-A1-1:/home/admin# ip add add 2000:0:0:100::1/56 dev lo
root@ASW-A1-1:/home/admin#
root@ASW-A1-1:/home/admin#

root@ASW-A1-1:/home/admin# cat /proc/net/if_inet6
20000000000001000000000000000001 01 38 00 80 lo
00000000000000000000000000000001 01 80 10 80 lo
30010000000000000000000000000001 01 80 00 80 lo
fe8000000000000002e0ecfffece1d76 02 40 20 80 eth0
root@ASW-A1-1:/home/admin#

root@ASW-A1-1:/home/admin# docker exec -it swss /usr/bin/restore_neighbors.py
Traceback (most recent call last):
  File "/usr/bin/restore_neighbors.py", line 25, in <module>
    from scapy.all import conf, in6_getnsma, inet_pton, inet_ntop, in6_getnsmac, get_if_hwaddr, Ether, ARP, IPv6, ICMPv6ND_NS, ICMPv6NDOptSrcLLAddr
  File "/usr/lib/python2.7/dist-packages/scapy/all.py", line 28, in <module>
    from scapy.route6 import *
  File "/usr/lib/python2.7/dist-packages/scapy/route6.py", line 275, in <module>
    _res = conf.route6.route("::/0")
  File "/usr/lib/python2.7/dist-packages/scapy/route6.py", line 216, in route
    if in6_isincluded(dst, p, plen):
  File "/usr/lib/python2.7/dist-packages/scapy/utils6.py", line 653, in in6_isincluded
    zero = inet_pton(socket.AF_INET6, prefix)
  File "/usr/lib/python2.7/dist-packages/scapy/pton_ntop.py", line 40, in inet_pton
    raise Exception("Illegal syntax for IP address")
Exception: Illegal syntax for IP address
root@ASW-A1-1:/home/admin# show version
SONiC Software Version: SONiC.HEAD.916-fd3f611
Distribution: Debian 9.8
Kernel: 4.9.0-8-2-amd64
Build commit: fd3f611
Build date: Tue Apr  2 22:13:17 UTC 2019
Built by: johnar@jenkins-worker-3

Docker images:
REPOSITORY                 TAG                 IMAGE ID            SIZE
docker-syncd-brcm          HEAD.916-fd3f611    b10b2956de94        361MB
docker-syncd-brcm          latest              b10b2956de94        361MB
docker-lldp-sv2            HEAD.916-fd3f611    919b8773169a        274MB
docker-lldp-sv2            latest              919b8773169a        274MB
docker-dhcp-relay          HEAD.916-fd3f611    6d2f5e867e25        256MB
docker-dhcp-relay          latest              6d2f5e867e25        256MB
docker-teamd               HEAD.916-fd3f611    132599ea2974        274MB
docker-teamd               latest              132599ea2974        274MB
docker-snmp-sv2            HEAD.916-fd3f611    2b1703f8e93c        294MB
docker-snmp-sv2            latest              2b1703f8e93c        294MB
docker-fpm-quagga          HEAD.916-fd3f611    4fda7adfc830        281MB
docker-fpm-quagga          latest              4fda7adfc830        281MB
docker-orchagent-brcm      HEAD.916-fd3f611    70aa2fca5572        315MB
docker-orchagent-brcm      latest              70aa2fca5572        315MB
docker-router-advertiser   HEAD.916-fd3f611    2b403dca1af4        279MB
docker-router-advertiser   latest              2b403dca1af4        279MB
docker-database            HEAD.916-fd3f611    36a965a077fe        280MB
docker-database            latest              36a965a077fe        280MB
docker-sonic-telemetry     HEAD.916-fd3f611    ea2b320d951f        300MB
docker-sonic-telemetry     latest              ea2b320d951f        300MB
docker-platform-monitor    HEAD.916-fd3f611    0a58e9257a87        323MB
docker-platform-monitor    latest              0a58e9257a87        323MB

root@ASW-A1-1:/home/admin# 
@jipanyang
Copy link
Collaborator Author

It looks the exact same issue: secdev/scapy#359
Fixed with secdev/scapy#363

@jipanyang
Copy link
Collaborator Author

The previous version:


root@sonic:/# scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
INFO: Can't import python Crypto lib. Won't be able to decrypt WEP.
INFO: Can't import python Crypto lib. Disabled certificate manipulation tools
Welcome to Scapy (2.2.0)

Current version: (what version ??)

root@ASW-A1-1:/home/admin# scapy
INFO: Can't import matplotlib. Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
INFO: Can't import python Crypto lib. Won't be able to decrypt WEP.
INFO: Can't import python Crypto lib. Disabled certificate manipulation tools
INFO: Can't import python ecdsa lib. Disabled certificate manipulation tools
Welcome to Scapy (unknown.version)
>>> 

StormLiangMS added a commit that referenced this issue Mar 30, 2023
Why I did it
832ef9c4 - Fix bug in GCU vlanintf_validator ([Bcm SAI] ugprade Broadcom SAI to version 3.3.5.4m-1 #2765) (5 minutes ago) [jingwenxie]
53f611b7 - Revert "Convert IPv6 addresses to lowercase in apply-patch (Add Pegatron project to branch 201807 #2299)" (Add note for running out of disk space in /var/lib/docker to README.md #2758) (20 hours ago) [jingwenxie]
79a21cef - Revert frr route check ([mlnx] fix url inconsistency in fw.mk #2761) (8 minutes ago) [StormLiangMS]
824680ed - Resolved rc!=0 problem by replacing fgrep with awk. Added ipv4 filtering to get only v4 peers in case of show ip bgp neighbors (Improve eeprom access reliability #2756) (30 hours ago) [saurabh17g]
10f31ea6 - Revert "Replace pickle by json (Add autoneg to 7170-Q59S20 #2636)" ([hostcfgd] Default value of fallthrough for authentication set to be False.  #2746) (7 days ago) [Mai Bui]
05fa7513 - Fix the show interface counters throwing exception on device with no external interfaces ([docker-platform-monitor]: Add smartmontools 6.6-1 #2703) (11 days ago) [abdosi]
f27dea0c - [route_check] remove check-frr_patch mock ([minigraph]: Mark both ERSPAN and ERSPANv6 as mirror ACL tables #2732) (11 days ago) [Stepan Blyshchak]
2d95529d - Revert "Update load minigraph to load backend acl (mlnx msn2010: default config_db.json generation with sonic-cfggen is not working #2236)" (swss stretch update broke restore_neighbors.py for neigh service #2735) (12 days ago) [Neetha John]
c869c970 - (master) Update the ref guide to reflect the vlan brief output ([teamd] update teamd docker to stretch and fix teamd_init failure #2731) (2 weeks ago) [Vivek]
76457141 - Fix fast-reboot DB migration ([teamd]: update teamd docker to stretch #2734) (2 weeks ago) [Aryeh Feigin]
f7f783bc - Enhance the logic to wait for all buffer tables to be removed in _clear_qos ([sfputil] Not able to read out values of voltage/temp/power on some cables  #2720) (2 weeks ago) [Stephen Sun]
e6179afa - Remove timer from FAST_REBOOT STATE_DB entry and use finalizer (Rollback kernel submodule update. #2621) (3 weeks ago) [Aryeh Feigin]
ff688323 - [route_check] fix IPv6 address handling ([docker pmon] install fancontrol & sensord #2722) (3 weeks ago) [Stepan Blyshchak]
7a604c51 - update fast-reboot ([201811][sairedis][swss] advance sub module head of sairedis and swss #2728) (3 weeks ago) [jhli-cisco]
9f83ace9 - [GCU] Add vlanintf-validator (Revert "[device/celestica] blacklist gpio_ich kernel module on haliburton" #2697) (3 weeks ago) [jingwenxie]
338d1c05 - Check SONiC dependencies before installation. ([sonic-slave]: Add iproute2 dependencies in stretch docker #2716) (3 weeks ago) [Liu Shilong]
64d2efd2 - Improve show acl commands ([sonic-utilities] update submodule #2667) (3 weeks ago) [bingwang-ms]
2ef5b31e - [GCU] Add PFC_WD RDMA validator ([sub module] advance sonic-utilities sub module for 201811 branch #2619) (3 weeks ago) [isabelmsft]
c7aa8416 - [show][muxcable] increase timeout for displaying HW_STATUS (Fixing get_transceiver_change_event #2712) (3 weeks ago) [vdahiya12]
2fc2b826 - YANG validation for ConfigDB Updates: MIRROR_SESSION use case ([mellanox] Update SDK to 4.3.0132 #2430) (3 weeks ago) [isabelmsft]
e16bdaae - Fix non-zero status exit on non secure boot system ([service] add warmboot finializer service #2715) (3 weeks ago) [kellyyeh]
90d70152 - [route_check] implement a check for FRR routes not marked offloaded (Feature to run an option platform specific script on the first boot #2531) (3 weeks ago) [Stepan Blyshchak]
c2bc150a - [warm/fast-reboot] Backup logs from tmpfs to disk during fast/warm shutdown ([swss]: update swss docker to stretch #2714) (3 weeks ago) [Vaibhav Hemant Dixit]
a015834d - [db_migrator] Add missing attribute 'weight' to route entries in APPL DB ([device/celestica] blacklist gpio_ich kernel module on seastone #2691) (4 weeks ago) [Vaibhav Hemant Dixit]
cd519aac - [ci] Fix pipeline issue caused by sonic-slave-* change. ([201803] Modify Debian apt repos to reflect changes made by maintainers #2709) (4 weeks ago) [Liu Shilong]
2680e6f3 - [dhcp_relay] Fix dhcp_relay restart error while add/del vlan ([thrift] add a patch to revert THRIFT-3650 #2688) (4 weeks ago) [Yaqiang Zhu]
How I did it
How to verify it
mihirpat1 pushed a commit to mihirpat1/sonic-buildimage that referenced this issue Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant