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

[action] [PR:20415] Add a patch for scapy to fix fd leak issue in AsyncSniffer (#20415) #20719

Open
wants to merge 1 commit into
base: 202405
Choose a base branch
from

Commits on Nov 6, 2024

  1. Add a patch for scapy to fix fd leak issue in AsyncSniffer (sonic-net…

    …#20415)
    
    Why I did it
    This PR is to add a patch to fix potential fd leak issue in AsyncSniffer in scapy python library.
    There are two fd leak scenarios.
    
    When starting worker thread _run, if an interface is down, an OSError is thrown, and the sockets that have been created will be leaked as it never got a chance to be closed.
    When stopping the worker thread, same error can happen when calling close. The sockets not closed will be leaked.
    
    How I did it
    Catch OSError when creating sockets, and catch any exception when closing socket to ensure all sockets are closed.
    
    How to verify it
    Verified by the testing code above. No fd leak happened.
    bingwang-ms authored and mssonicbld committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    20340a4 View commit details
    Browse the repository at this point in the history