Skip to content

[bgpcfgd]: Fix bgpcfgd crash on reset Loopback0 ip addresses#5050

Merged
lguohan merged 2 commits intosonic-net:201811from
pavel-shirshov:pavelsh/bgpcfgd_amb
Jul 28, 2020
Merged

[bgpcfgd]: Fix bgpcfgd crash on reset Loopback0 ip addresses#5050
lguohan merged 2 commits intosonic-net:201811from
pavel-shirshov:pavelsh/bgpcfgd_amb

Conversation

@pavel-shirshov
Copy link
Copy Markdown
Contributor

@pavel-shirshov pavel-shirshov commented Jul 27, 2020

Also some typos were fixed

- Why I did it

  1. Fix an error which causes bgpcfgd crash on invalid ip address. Before the fix we had an issue here. When either loopback ipv4 or ipv6 addresses were already set and bgpcfgd received another "SET" message for already set ip loopback address, bgpcfgd will send syslog message about ambiguous ip address (despite the fact that the address is good) and crash of bgpcfgd. With this change this behavior is changed: if we receive ip address and this ip address is already set, bgpcfgd will send this message to the syslog and return from the handler.

  2. Fix typos

- How I did it
Return from the handler on invalid ip address

- How to verify it
Build an image, run on your dut. Add an interface entry with invalid ip address. bgpcfgd should not crash.

admin@str-s6100-acs-1:~$ redis-cli 
127.0.0.1:6379> select 4
OK
127.0.0.1:6379[4]> keys L*
1) "LOOPBACK_INTERFACE|Loopback0|FC00:1::32/128"
2) "LOOPBACK_INTERFACE|Loopback0|10.1.0.32/32"
127.0.0.1:6379[4]> hgetall "LOOPBACK_INTERFACE|Loopback0|10.1.0.32/32"
1) "NULL"
2) "NULL"
127.0.0.1:6379[4]> hset "LOOPBACK_INTERFACE|Loopback0|10.1.0.32/32" NULL NULL
(integer) 0
127.0.0.1:6379[4]> hset "LOOPBACK_INTERFACE|Loopback0|FC00:1::32/128" NULL NULL
(integer) 0
admin@str-s6100-acs-1:~$ sudo tail -F /var/log/syslog | grep bgpcfgd


Jul 27 18:54:32.241152 str-s6100-acs-1 INFO bgp#bgpcfgd: Update command is not supported for set src templates. lo_ip='10.1.0.32'

Jul 27 18:54:57.701735 str-s6100-acs-1 INFO bgp#bgpcfgd: Update command is not supported for set src templates. lo_ip='FC00:1::32'

- Which release branch to backport (provide reason below if seleted)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Jul 27, 2020

are you missing some changes in this pr?

@pavel-shirshov pavel-shirshov changed the title Return on invalid address, otherwise crash [bgpcfgd]: Return on invalid address, otherwise crash Jul 27, 2020
@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Jul 28, 2020

is this bug only affecting Loopback0? It is unclear how when this bug is triggered.

@pavel-shirshov
Copy link
Copy Markdown
Contributor Author

@lguohan. I've updated description. This issue is for "Loopback0" only.

@pavel-shirshov pavel-shirshov changed the title [bgpcfgd]: Return on invalid address, otherwise crash [bgpcfgd]: Fix bgpcfgd crash on reset Loopback0 ip addresses Jul 28, 2020
@lguohan lguohan merged commit 459c29c into sonic-net:201811 Jul 28, 2020
@pavel-shirshov pavel-shirshov deleted the pavelsh/bgpcfgd_amb branch July 28, 2020 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants