I am trying to count a passed in pointer string in BPF but I am left with this really long error that I am unable to understand. I am basically trying to recreate strlen within BPF to count the size of my passed in string*. The interesting area from the error can be seen here:
R1 min value is outside of the allowed memory range processed 2353 insns (limit 1000000) max_states_per_insn 1 total_states 242 peak_states 242 mark_read 2
Any idea on how to resolve something else?
Here is the code I have written:
int stringLength(char* txt)
{
int i=0,count=0;
while(txt[i++]!='\0'){
count+=1;
}
return count;
}
It is a helper function that I am calling within my main BPF function.