[Cake] issue with Cake and bpf filter
toke at toke.dk
Wed Aug 22 05:41:52 EDT 2018
Toke Høiland-Jørgensen <toke at toke.dk> writes:
>>Lastly, if anyone has time to review even just a little code for what
>>is or is not good or idiomatic C, post an issue and I’d appreciate it.
>>Yes, I yield to the ‘goto’ proponents when it comes to error handling
>>and resource de-allocation. :)
> I'll take a look tomorrow :)
I can tell from the code that you're coming from Go. But the only thing
I found strange on a cursory glance was your error handling method of
returning a pointer that is NULL on success. I know this corresponds to
"return 0 on success", but, well I was thrown off by the "return NULL"
statements in functions indicating success. The usual pattern is to
return the error code, and pass in a pointer to the error struct that is
only filled if the return code is != 0.
This is very much a matter of taste, though, and if you prefer your
current style just keep it :)
More information about the Cake