mirror of https://github.com/aya-rs/aya
aya: fix tc name limit
The buffer for attributes should be sized to hold at least 256 bytes, based on `CLS_BPF_NAME_LEN = 256` from the kernel: https://github.com/torvalds/linux/blob/02aee814/net/sched/cls_bpf.c#L28 Fixes: #610 aya: add netlink_clsact_qdisc_exists function public-api: add clsact_qdisc_exists integration-test: add tc_name_limit integration-test: add tc_name_limit_exceeded Signed-off-by: Mohammad Javad Pooladkhay <m.pooladkhay@gmail.com>pull/728/head
parent
b1769678f4
commit
9606690a73
@ -0,0 +1,22 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use aya_bpf::{macros::classifier, programs::TcContext};
|
||||
|
||||
// A function with a 256-byte-long name (all 'a's) to be used as the name of
|
||||
// the ebpf program. This name must match the name passed to userspace side
|
||||
// of the program (i.e. test/integration-test/src/tests/load.rs).
|
||||
// 256 is the maximum length allowed by the kernel, so this test should pass.
|
||||
// https://github.com/torvalds/linux/blob/02aee814/net/sched/cls_bpf.c#L28
|
||||
#[classifier]
|
||||
pub fn aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
|
||||
_ctx: TcContext,
|
||||
) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[panic_handler]
|
||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use aya_bpf::{macros::classifier, programs::TcContext};
|
||||
|
||||
// A function with a 257-byte-long name (all 'a's) to be used as the name of
|
||||
// the ebpf program. This name must match the name passed to userspace side
|
||||
// of the program (i.e. test/integration-test/src/tests/load.rs).
|
||||
// 256 is the maximum length allowed by the kernel, so this test should fail.
|
||||
// https://github.com/torvalds/linux/blob/02aee814/net/sched/cls_bpf.c#L28
|
||||
#[classifier]
|
||||
pub fn aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
|
||||
_ctx: TcContext,
|
||||
) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[panic_handler]
|
||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
Loading…
Reference in New Issue