Skip to content

[202205] Re-add 127.0.0.1/8 when bringing down the interfaces#15462

Merged
yxieca merged 1 commit intosonic-net:202205from
saiarcot895:202205-fix-loopback-address-missing
Jun 14, 2023
Merged

[202205] Re-add 127.0.0.1/8 when bringing down the interfaces#15462
yxieca merged 1 commit intosonic-net:202205from
saiarcot895:202205-fix-loopback-address-missing

Conversation

@saiarcot895
Copy link
Contributor

Cherry-pick of #15080

  • Re-add 127.0.0.1/8 when bringing down the interfaces

With #5353, 127.0.0.1/16 was added to the lo interface, and then 127.0.0.1/8 was removed. However, when bringing down the lo interface, like during a config reload, 127.0.0.1/16 gets removed, but 127.0.0.1/8 isn't added back to the interface. This means that there's a period of time where 127.0.0.1 is not available at all, and services that need to connect to 127.0.01 (such as for redis DB) will fail.

To fix this, when going down, add 127.0.0.1/8. Add this address before the existing configuration gets removed, so that 127.0.0.1 is available at all times.

Note that running ifdown lo doesn't actually bring down the loopback interface; the interface always stays "physically" up.

Why I did it

Work item tracking
  • Microsoft ADO (number only): 18637195, 17169507

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

* Re-add 127.0.0.1/8 when bringing down the interfaces

With sonic-net#5353, 127.0.0.1/16 was added to the lo interface, and then
127.0.0.1/8 was removed. However, when bringing down the lo interface,
like during a config reload, 127.0.0.1/16 gets removed, but 127.0.0.1/8
isn't added back to the interface. This means that there's a period of
time where 127.0.0.1 is not available at all, and services that need to
connect to 127.0.01 (such as for redis DB) will fail.

To fix this, when going down, add 127.0.0.1/8. Add this address before
the existing configuration gets removed, so that 127.0.0.1 is available
at all times.

Note that running `ifdown lo` doesn't actually bring down the loopback
interface; the interface always stays "physically" up.

Signed-off-by: Saikrishna Arcot <[email protected]>
@saiarcot895 saiarcot895 requested a review from lguohan as a code owner June 14, 2023 18:39
@saiarcot895 saiarcot895 requested a review from yxieca June 14, 2023 23:27
@yxieca yxieca merged commit 9e16a7a into sonic-net:202205 Jun 14, 2023
@saiarcot895 saiarcot895 deleted the 202205-fix-loopback-address-missing branch June 15, 2023 20:41
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