Wrap TC filter errors - #287
Merged
Merged
Conversation
The two failures raised when a TC filter is added to an interface, or read back from it, are built without keeping their cause attached, so callers are left with a message and nothing they can match on. Both of them carry the reason the interface could not be programmed, and a missing device is the common one: an interface handed over to the network namespace of a container disappears while its classifier is being attached. Callers that want to tell that apart from a real failure currently have no choice but to compare the text of the message. Every other failure of this file already keeps its cause, and the text these two produce is unchanged, so this only makes them behave the way callers expect.
usamasaqib
approved these changes
Sep 3, 2026
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Sep 3, 2026
…il (#55835) ### What does this PR do? Accounts for two failures of the network namespace resolver that were reported as unclassified. ### Motivation Container runtimes move network interfaces to the network namespace of the container as soon as they create them, so errors such as "no such device" or "filter not found" midway into attaching new TC filters are expected. Since interfaces are tracked by the `dev_change_net_namespace` hook, the TC filter attachments are retried after the interface move is done. ### Describe how you validated your changes Unit test on the error classification. ### Additional Notes The `ebpf-manager` dependency bump brings in [this change](DataDog/ebpf-manager#287) and allows properly classifying "no such device" errors occurring when an interface is moved from one network namespace to another. Co-authored-by: yoann.ghigoff <yoann.ghigoff@datadoghq.com>
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 does this PR do?
Wrap two error cases in
tc.goMotivation
Allow users to match on the wrapped error.
Additional Notes
Other error cases in
tc.gowere already wrapped.Describe how to test your changes