Is there any valid use case of bpf_csum_diff where from_size > 0, to_size = 0 and the return value is negative? #574
-
Excerpts of the documentation for
Is there any valid use case of this function with the following? If NOT, wouldn't that mean that in the above case the return value from the function will be <0 and that conflicts with the constraint that return value is <0 only in error case? @qmonnet , @teknoraver ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I believe the checksum computed by the helper is on 32 bits, but the helper itself returns a As for the use case, I know about as much as the helper's doc: it can be useful when we remove data from a packet. |
Beta Was this translation helpful? Give feedback.
I believe the checksum computed by the helper is on 32 bits, but the helper itself returns a
s64
throughr0
which is 64-bit long. So in that case the checksum returned should always be expressed as a positive 64-bit integer, unless I'm missing something?As for the use case, I know about as much as the helper's doc: it can be useful when we remove data from a packet.