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

[master]fix #4716 show ipv6 interfaces neighbor_ip is N/A issue #948

Merged
merged 1 commit into from
Jun 24, 2020
Merged

[master]fix #4716 show ipv6 interfaces neighbor_ip is N/A issue #948

merged 1 commit into from
Jun 24, 2020

Conversation

tim-rj
Copy link
Contributor

@tim-rj tim-rj commented Jun 18, 2020

  • Why I did it

    When exec 'show ipv6 interfaces', the neighbor_ip will always be 'N/A' which will confuse the consumers. After checking we found that this is a show issue. As we know, there will be one local linked IPV6 address for every valid interface. In show/main.py, the interface's ipv6 neighbor ip will always be written by this local linked IPV6's neighbor_ip address which is 'N/A'. And i think this part code of 'show ipv6 interface' was copied from 'show ip interface' before, right? Yea, some change is necessary!

  • What I did

    This is bug fixing. Using a array to store neighbor info in case that the old one be written by the newer one.

  • How I did it

    Code change.

  • How to verify it
    Upgrate config_db.config attached in show ipv6 interfaces command result doesn't conclude neighbor ipv6 address sonic-buildimage#4716 and show ipv6 interfaces

  • Previous command output (if the output of a command-line utility has changed)

root@switch2:/usr/lib/python2.7/dist-packages/show# show ipv6 interfaces
Interface     Master        IPv6 address/mask                          Admin/Oper    BGP Neighbor    Neighbor IP
------------  ------------  -----------------------------------------  ------------  --------------  -------------
Bridge                      fe80::fce5:f4ff:fed5:b262%Bridge/64        up/up         N/A             N/A
Ethernet0     PortChannel1  fe80::5a69:6cff:fefb:2230%Ethernet0/64     up/up         N/A             N/A
Ethernet52                  2001:50:5:1::5/64                          up/up         N/A             N/A
                            2001:50:5:1::4/64
                            2001:50:5:1::3/64
                            2001:50:5:1::2/64
                            fe80::5a69:6cff:fefb:2230%Ethernet52/64
Loopback0                   6::6/128                                   up/up         N/A             N/A
                            fe80::44cb:61ff:fe6b:4d41%Loopback0/64
PortChannel1  Bridge        fe80::5a69:6cff:fefb:2230%PortChannel1/64  up/up         N/A             N/A
Vlan3                       150::1/64                                  up/up         N/A             N/A
                            fe80::5a69:6cff:fefb:2230%Vlan3/64
eth0                        fe80::5a69:6cff:fefb:2230%eth0/64          up/up         N/A             N/A
lo                          ::1/128                                    up/up         N/A             N/A
root@switch2:/usr/lib/python2.7/dist-packages/show#

  • New command output (if the output of a command-line utility has changed)
root@switch2:/home/admin# show ipv6 interfaces
Interface     Master        IPv6 address/mask                          Admin/Oper    BGP Neighbor    Neighbor IP
------------  ------------  -----------------------------------------  ------------  --------------  --------------
Bridge                      fe80::fce5:f4ff:fed5:b262%Bridge/64        up/up         N/A             N/A
Ethernet0     PortChannel1  fe80::5a69:6cff:fefb:2230%Ethernet0/64     up/up         N/A             N/A
Ethernet52                  2001:50:5:1::5/64                          up/up         LCv6            2001:50:5:1::9
                            2001:50:5:1::4/64                          up/up         LCv6            2001:50:5:1::8
                            2001:50:5:1::3/64                          up/up         LCv6            2001:50:5:1::7
                            2001:50:5:1::2/64                          up/up         LCv6            2001:50:5:1::1
                            fe80::5a69:6cff:fefb:2230%Ethernet52/64    up/up         N/A             N/A
Loopback0                   6::6/128                                   up/up         N/A             N/A
                            fe80::44cb:61ff:fe6b:4d41%Loopback0/64     up/up         N/A             N/A
PortChannel1  Bridge        fe80::5a69:6cff:fefb:2230%PortChannel1/64  up/up         N/A             N/A
Vlan3                       150::1/64                                  up/up         N/A             N/A
                            fe80::5a69:6cff:fefb:2230%Vlan3/64         up/up         N/A             N/A
eth0                        fe80::5a69:6cff:fefb:2230%eth0/64          up/up         N/A             N/A
lo                          ::1/128                                    up/up         N/A             N/A

@tim-rj
Copy link
Contributor Author

tim-rj commented Jun 18, 2020

@prsunny as mentioned in #938, this issue exists in master branch also, I create pull request for master branch here. Please check check_log below:
check_log.txt

@prsunny
Copy link
Contributor

prsunny commented Jun 23, 2020

@tim-rj, can you provide the previous show output and the new output as required by the description template? Also please use the code format for properly aligning the output

@tim-rj
Copy link
Contributor Author

tim-rj commented Jun 23, 2020

@prsunny I have updated 'Previous command output' and 'New command output ' above, please help check again. (If want to check the neighbor info correct or not , please check file->
check_log.txt
)

@@ -1557,6 +1558,7 @@ def interfaces():
neighbor_ip = bgp_peer[local_ip][1]
except Exception:
pass
neighbor_info.append([neighbor_name, neighbor_ip])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to have the mapping based on the ipaddr (dictionary) instead of an implicit index? Just a thought!

@tim-rj
Copy link
Contributor Author

tim-rj commented Jun 24, 2020

Please help arrange merging, thanks!

@prsunny prsunny merged commit f99f7e1 into sonic-net:master Jun 24, 2020
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants