Skip to content

Is there any valid use case of bpf_csum_diff where from_size > 0, to_size = 0 and the return value is negative? #574

Answered by qmonnet
shankarseal asked this question in Q&A
Discussion options

You must be logged in to vote

I believe the checksum computed by the helper is on 32 bits, but the helper itself returns a s64 through r0 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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shankarseal
Comment options

shankarseal Sep 20, 2021
Maintainer Author

@shankarseal
Comment options

shankarseal Sep 21, 2021
Maintainer Author

Answer selected by dthaler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants