On 7/17/23 7:14 PM, Stanislav Fomichev wrote: [...]
Andrii was asking whether we need to explicitly reject zero in [0] and we've been chatting with Alexei about the same in [1]. So are we trying to be more flexible here on purpose or should we outright return -EINVAL for 0 id_or_fd? (or am I misreading this part?)
I was thinking if we can support it then why not, but fair enough, I changed it in v6 into ... if (id) <resolve id> else if (id_or_fd) <resolve fd> ... format and rejecting 0 fd case with error. The !id_or_fd && !id case I moved out of bpf_mprog_prog() and one layer up into bpf_mprog_tuple_relative() with a comment to avoid confusion on why it is there. This is the case when we have before/after with no object (and no id/link flag) for the prepend/append case.
The rest looks great, thanks for the docs indeed!
Thanks!
0: https://lore.kernel.org/bpf/CAEf4Bza_X30yLPm0Lhy2c-u1Qw1Ci9AVoy5jo_XXCaT9zz+3jg@xxxxxxxxxxxxxx/ 1: https://lore.kernel.org/bpf/CAKH8qBsr5vYijQSVv0EO8TF7zfoAdAaWC8jpVKK_nGSgAoyiQg@xxxxxxxxxxxxxx/#t