Skip to content

Wrap TC filter errors - #287

Merged
YoannGh merged 1 commit into
mainfrom
yoanngh/tc-wrap-filter-errors
Sep 3, 2026
Merged

Wrap TC filter errors#287
YoannGh merged 1 commit into
mainfrom
yoanngh/tc-wrap-filter-errors

Conversation

@YoannGh

@YoannGh YoannGh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Wrap two error cases in tc.go

Motivation

Allow users to match on the wrapped error.

Additional Notes

Other error cases in tc.go were already wrapped.

Describe how to test your changes

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.
@YoannGh
YoannGh requested a review from a team as a code owner September 3, 2026 13:05
@YoannGh YoannGh changed the title Keep the cause attached to the TC filter failures Wrap TC filter errors Sep 3, 2026
@YoannGh
YoannGh merged commit b6522e2 into main Sep 3, 2026
5 checks passed
@YoannGh
YoannGh deleted the yoanngh/tc-wrap-filter-errors branch September 3, 2026 13:20
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants