diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index 79432d4d6..babcb888f 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -176,10 +176,6 @@ fn compute_kconfig_definition(features: &Features) -> HashMap> { Some('y') => to_bytes(1).to_vec(), Some('m') => to_bytes(2).to_vec(), Some('"') => { - if raw_value.len() > 2 || raw_value.ends_with('"') { - continue; - } - let raw_value = &raw_value[1..raw_value.len() - 1]; raw_value.as_bytes().to_vec() diff --git a/test/integration-test/bpf/kconfig.bpf.c b/test/integration-test/bpf/kconfig.bpf.c index 37ba61cba..2a7859518 100644 --- a/test/integration-test/bpf/kconfig.bpf.c +++ b/test/integration-test/bpf/kconfig.bpf.c @@ -9,6 +9,8 @@ extern unsigned int CONFIG_BPF __kconfig; extern unsigned int CONFIG_PANIC_TIMEOUT __kconfig; // CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 extern unsigned int CONFIG_DEFAULT_HUNG_TASK_TIMEOUT __kconfig; +// CONFIG_DEFAULT_HOSTNAME +extern char CONFIG_DEFAULT_HOSTNAME[] __kconfig; SEC("xdp") int kconfig(struct xdp_md *ctx) { @@ -24,6 +26,12 @@ int kconfig(struct xdp_md *ctx) { return XDP_DROP; } + for (int i = 0; i < 7; i++) { + if ("(none)"[i] != CONFIG_DEFAULT_HOSTNAME[i]) { + return XDP_DROP; + } + } + return XDP_PASS; }