Skip to content

[sonic-mgmt][BFD][issues/17418]fix bfd responder crash#17419

Merged
bingwang-ms merged 3 commits intosonic-net:masterfrom
baorliu:baorliu_fix_bfd_responder
Mar 25, 2025
Merged

[sonic-mgmt][BFD][issues/17418]fix bfd responder crash#17419
bingwang-ms merged 3 commits intosonic-net:masterfrom
baorliu:baorliu_fix_bfd_responder

Conversation

@baorliu
Copy link
Copy Markdown
Contributor

@baorliu baorliu commented Mar 7, 2025

Description of PR

fix bug #17418
These 2 cases may cause BFD related mgmt test fails:
1, bfd responder can receive the packet it sent. and at the time of restart, partial packet could be process and cause it crash
2, In the case of bfd_responder restart and it get BFD UP packet, the packet become uninitialized, it cause socket sending packet error.

Summary:
Fixes # (issue)
#17418

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

set a breakpoint in a sonic_mgmt test (test_bfd.py), using a separately python script to craft and send BFD packet from the DUT to bfd_responder. it can trigger the second issue listed in the description section.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@baorliu baorliu changed the title [BFD][issues/17418]fix bfd responder crash [sonic-mgmt][BFD][issues/17418]fix bfd responder crash Mar 7, 2025
@Aravind-Subbaroyan
Copy link
Copy Markdown

@kevinwangsk - please review this

kevinskwang
kevinskwang previously approved these changes Mar 14, 2025
Copy link
Copy Markdown
Contributor

@kevinskwang kevinskwang left a comment

Choose a reason for hiding this comment

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

LGTM

bpar9
bpar9 previously approved these changes Mar 18, 2025
@wangxin wangxin linked an issue Mar 19, 2025 that may be closed by this pull request
@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Mar 19, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

update comment format
@baorliu baorliu dismissed stale reviews from bpar9 and kevinskwang via 792f95a March 24, 2025 18:59
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Fix format issue:
bfd_responder.py:130:69: E225 missing whitespace around operator
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@baorliu
Copy link
Copy Markdown
Contributor Author

baorliu commented Mar 24, 2025

@wangxin , could you please help rerun the azp? last failures is DUT host unreachable. thanks.

Error type: DUTHOST_UNREACHABLE
Error message: DUT host unreachable for vms-kvm-dual-t0 on running test_pretest.py|||vms-kvm-dual-t0_479323
Operation failed with exception: Exception('Test plan id: 67e1b077d2e0a216f8de2c5b, status: FAILED, result: FAILED, Elapsed 542 seconds. Check https://elastictest.org/scheduler/testplan/67e1b077d2e0a216f8de2c5b for test plan status')

@bpar9
Copy link
Copy Markdown
Collaborator

bpar9 commented Mar 24, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@baorliu
Copy link
Copy Markdown
Contributor Author

baorliu commented Mar 25, 2025

hi @bingwang-ms, @prabhataravind, could you please help review this PR?

@bingwang-ms bingwang-ms merged commit ba14046 into sonic-net:master Mar 25, 2025
17 checks passed
amulyan7 pushed a commit to amulyan7/sonic-mgmt that referenced this pull request Mar 31, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
@wsycqyz
Copy link
Copy Markdown
Contributor

wsycqyz commented Apr 1, 2025

@kevinskwang FYI

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Apr 1, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202411: #17771

mssonicbld pushed a commit that referenced this pull request Apr 1, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
OriTrabelsi pushed a commit to OriTrabelsi/sonic-mgmt that referenced this pull request Apr 1, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
* fix bfd responder crash

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug:bfd_responder crash when process partial packet sent by itself

8 participants