Re: [PATCH bpf-next v3 1/2] bpf: add bpf_strcasestr,bpf_strncasestr kfuncs
From: Alexei Starovoitov
Date: Tue Oct 07 2025 - 00:09:02 EST
On Mon, Oct 6, 2025 at 8:00 PM Rong Tao <rtoax@xxxxxxxxxxx> wrote:
>
> +/**
> + * bpf_strnstr - Find the first substring in a length-limited string, ignoring
> + * the case of the characters
> + * @s1__ign: The string to be searched
> + * @s2__ign: The string to search for
> + * @len: the maximum number of characters to search
> + *
> + * Return:
> + * * >=0 - Index of the first character of the first occurrence of @s2__ign
> + * within the first @len characters of @s1__ign
> + * * %-ENOENT - @s2__ign not found in the first @len characters of @s1__ign
> + * * %-EFAULT - Cannot read one of the strings
> + * * %-E2BIG - One of the strings is too large
> + * * %-ERANGE - One of the strings is outside of kernel address space
> + */
> +__bpf_kfunc int bpf_strncasestr(const char *s1__ign, const char *s2__ign,
> + size_t len)
See AI review for the above part.
pw-bot: cr