Run ip neigh flush before removing the IP address from the interface#3281
Merged
saiarcot895 merged 2 commits intosonic-net:masterfrom Apr 29, 2024
Merged
Run ip neigh flush before removing the IP address from the interface#3281saiarcot895 merged 2 commits intosonic-net:masterfrom
ip neigh flush before removing the IP address from the interface#3281saiarcot895 merged 2 commits intosonic-net:masterfrom
Conversation
In the test_po_update test case, one of the things done there is to remove an IP address from a port channel interface. As part of that, the current handling for that issues a `ip neigh flush dev ...` command, added in sonic-net#606, presumably to remove old neighbor entries that would no longer be valid. I would think that the kernel would automatically do this, but maybe it didn't back then; I'm not sure if there's been a behavior change here since then. In some cases, this command is returning an error, saying "Failed to send flush request: No such file or directory". I'm not sure why this is; maybe when iproute2 is going through the list of neighbors, some neighbor entry was there, but then by the time it issued the deletion request, that neighbor entry was removed by the kernel since the IP address was removed. Either way, I don't believe a failure here is critical. Therefore, ignore any failures from running this command. Signed-off-by: Saikrishna Arcot <[email protected]>
prsunny
previously approved these changes
Apr 22, 2024
This should make sure that the IP neighbor flush should always work. This also requires the tests to be updated, to mock out the flush command call since that interface won't exist. Signed-off-by: Saikrishna Arcot <[email protected]>
ip neigh fluship neigh flush before removing the IP address from the interface
prsunny
approved these changes
Apr 29, 2024
arfeigin
pushed a commit
to arfeigin/sonic-utilities
that referenced
this pull request
Jun 16, 2024
sonic-net#3281) * Ignore any error returned from `ip neigh flush` In the test_po_update test case, one of the things done there is to remove an IP address from a port channel interface. As part of that, the current handling for that issues a `ip neigh flush dev ...` command, added in sonic-net#606, presumably to remove old neighbor entries that would no longer be valid. I would think that the kernel would automatically do this, but maybe it didn't back then; I'm not sure if there's been a behavior change here since then. In some cases, this command is returning an error, saying "Failed to send flush request: No such file or directory". I'm not sure why this is; maybe when iproute2 is going through the list of neighbors, some neighbor entry was there, but then by the time it issued the deletion request, that neighbor entry was removed by the kernel since the IP address was removed. Either way, I don't believe a failure here is critical. Therefore, ignore any failures from running this command. Signed-off-by: Saikrishna Arcot <[email protected]> * Move the IP neighbor flush to be before the IP address removal This should make sure that the IP neighbor flush should always work. This also requires the tests to be updated, to mock out the flush command call since that interface won't exist. Signed-off-by: Saikrishna Arcot <[email protected]> --------- Signed-off-by: Saikrishna Arcot <[email protected]>
nmoray
pushed a commit
to nmoray/sonic-utilities
that referenced
this pull request
Jun 25, 2025
sonic-net#3281) * Ignore any error returned from `ip neigh flush` In the test_po_update test case, one of the things done there is to remove an IP address from a port channel interface. As part of that, the current handling for that issues a `ip neigh flush dev ...` command, added in sonic-net#606, presumably to remove old neighbor entries that would no longer be valid. I would think that the kernel would automatically do this, but maybe it didn't back then; I'm not sure if there's been a behavior change here since then. In some cases, this command is returning an error, saying "Failed to send flush request: No such file or directory". I'm not sure why this is; maybe when iproute2 is going through the list of neighbors, some neighbor entry was there, but then by the time it issued the deletion request, that neighbor entry was removed by the kernel since the IP address was removed. Either way, I don't believe a failure here is critical. Therefore, ignore any failures from running this command. Signed-off-by: Saikrishna Arcot <[email protected]> * Move the IP neighbor flush to be before the IP address removal This should make sure that the IP neighbor flush should always work. This also requires the tests to be updated, to mock out the flush command call since that interface won't exist. Signed-off-by: Saikrishna Arcot <[email protected]> --------- Signed-off-by: Saikrishna Arcot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
In the test_po_update test case, one of the things done there is to remove an IP address from a port channel interface. As part of that, the current handling for that issues a
ip neigh flush dev ...command, added in #606, presumably to remove old neighbor entries that would no longer be valid. I would think that the kernel would automatically do this, but maybe it didn't back then; I'm not sure if there's been a behavior change here since then.In some cases, this command is returning an error, saying "Failed to send flush request: No such file or directory". I'm not sure why this is; maybe when iproute2 is going through the list of neighbors, some neighbor entry was there, but then by the time it issued the deletion request, that neighbor entry was removed by the kernel since the IP address was removed. Either way, I don't believe a failure here is critical.
To get around this, run the
ip neigh flushcommand before removing the IP address from the interface. This should make sure it succeeds. Also, update the test cases to mock out this call (so that it doesn't return an error here and bail early) and update the exit code.How I did it
How to verify it
The
ip neigh flushfailure appears to be flaky, but I've seen a small uptick in those failures recently. I haven't been able to repro the error on my dev VM, so I'm not sure if this is a good enough fix if it does run into the failure case.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)