Skip to content

Commit

Permalink
Ignore any error returned from ip neigh flush
Browse files Browse the repository at this point in the history
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/sonic-buildimage#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 <sarcot@microsoft.com>
  • Loading branch information
saiarcot895 committed Apr 22, 2024
1 parent 07d6d27 commit da0003d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4702,7 +4702,7 @@ def remove(ctx, interface_name, ip_addr):
command = ['sudo', 'ip', 'netns', 'exec', str(ctx.obj['namespace']), 'ip', 'neigh', 'flush', 'dev', str(interface_name), str(ip_address)]
else:
command = ['ip', 'neigh', 'flush', 'dev', str(interface_name), str(ip_address)]
clicommon.run_command(command)
clicommon.run_command(command, ignore_error=True)

#
# 'loopback-action' subcommand
Expand Down

0 comments on commit da0003d

Please sign in to comment.