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

Investigate workaround in privileged tests for netlink.RuleAdd() returning EINVAL #14383

Closed
christarazi opened this issue Dec 11, 2020 · 5 comments · Fixed by #26486
Closed
Assignees
Labels
kind/bug This is a bug in the Cilium logic. pinned These issues are not marked stale by our issue bot. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. sig/loader Impacts the loading of BPF programs into the kernel.

Comments

@christarazi
Copy link
Member

See #14337 (comment). For now the workaround is to shell out to ip rule add instead of using the netlink library.

@christarazi christarazi added the kind/bug This is a bug in the Cilium logic. label Dec 11, 2020
@pchaigno
Copy link
Member

pchaigno commented Dec 12, 2020

For quicker future reference: we'd like to replace the tc call with the following (or similar):

c.Assert(netlink.RuleAdd(&netlink.Rule{
	Src:      &net.IPNet{IP: net.ParseIP("172.2.0.2"), Mask: net.CIDRMask(32, 32)},
	Priority: linux_defaults.RulePriorityEgress,
	Table:    dummy.Index,
}), IsNil)

@christarazi
Copy link
Member Author

This can be useful to trace netlink requests to the kernel: https://github.com/socketpair/nltrace

@brb
Copy link
Member

brb commented Jan 4, 2021

Alternatively, the recent enough strace version should help you to compare both netlink requests. If that doesn't work, then https://docs.pyroute2.org/debug.html might be useful.

@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Jun 26, 2021
@pchaigno pchaigno added pinned These issues are not marked stale by our issue bot. and removed stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. labels Jun 28, 2021
@ti-mo ti-mo added sig/loader Impacts the loading of BPF programs into the kernel. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. labels Jun 21, 2023
@ti-mo ti-mo self-assigned this Jun 21, 2023
ti-mo added a commit to ti-mo/cilium that referenced this issue Jun 26, 2023
The default value of a netlink.Rule does not seem to be useful.
netlink.NewRule must be used instead.

Fixes: cilium#14383

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo
Copy link
Contributor

ti-mo commented Jun 26, 2023

@christarazi Turns out the default value of netlink.Rule cannot be used: #26486.

ti-mo added a commit that referenced this issue Jun 26, 2023
The default value of a netlink.Rule does not seem to be useful.
netlink.NewRule must be used instead.

Fixes: #14383

Signed-off-by: Timo Beckers <timo@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic. pinned These issues are not marked stale by our issue bot. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. sig/loader Impacts the loading of BPF programs into the kernel.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants