| 185a108f | 12-Jun-2021 |
Alex Elder <[email protected]> |
net: qualcomm: rmnet: IPv6 payload length is simple
We don't support any extension headers for IPv6 packets. Extension headers therefore contribute 0 bytes to the payload length. As a result we ca
net: qualcomm: rmnet: IPv6 payload length is simple
We don't support any extension headers for IPv6 packets. Extension headers therefore contribute 0 bytes to the payload length. As a result we can just use the IPv6 payload length as the length used to compute the pseudo header checksum for both UDP and TCP messages.
Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 411a795e | 12-Jun-2021 |
Alex Elder <[email protected]> |
net: qualcomm: rmnet: drop some unary NOTs
We compare a payload checksum with a pseudo checksum value for equality in rmnet_map_ipv4_dl_csum_trailer(). Both of those values are computed with a unar
net: qualcomm: rmnet: drop some unary NOTs
We compare a payload checksum with a pseudo checksum value for equality in rmnet_map_ipv4_dl_csum_trailer(). Both of those values are computed with a unary NOT (~) operation. The result of the comparison is the same if we omit that NOT for both values.
Remove these operations in rmnet_map_ipv6_dl_csum_trailer() also.
Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| be754f64 | 12-Jun-2021 |
Alex Elder <[email protected]> |
net: qualcomm: rmnet: trailer value is a checksum
The csum_value field in the rmnet_map_dl_csum_trailer structure is a "real" Internet checksum. It is a 16 bit value, in big endian format, which re
net: qualcomm: rmnet: trailer value is a checksum
The csum_value field in the rmnet_map_dl_csum_trailer structure is a "real" Internet checksum. It is a 16 bit value, in big endian format, which represents an inverted ones' complement sum over pairs of bytes.
Make that clear by changing its type to __sum16.
This makes a typecast in rmnet_map_ipv4_dl_csum_trailer() and another in rmnet_map_ipv6_dl_csum_trailer() unnecessary.
Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 698aa6c4 | 12-Jun-2021 |
Alex Elder <[email protected]> |
net: qualcomm: rmnet: remove unneeded code
The previous patch makes rmnet_map_ipv4_dl_csum_trailer() return early with an error if it is determined that the computed checksum for the IP payload does
net: qualcomm: rmnet: remove unneeded code
The previous patch makes rmnet_map_ipv4_dl_csum_trailer() return early with an error if it is determined that the computed checksum for the IP payload does not match what was expected.
If the computed checksum *does* match the expected value, the IP payload (i.e., the transport message), can be considered good. There is no need to do any further processing of the message.
This means a big block of code is unnecessary for validating the transport checksum value, and can be removed.
Make comparable changes in rmnet_map_ipv6_dl_csum_trailer().
Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| fab01a6f | 12-Jun-2021 |
Alex Elder <[email protected]> |
net: qualcomm: rmnet: return earlier for bad checksum
In rmnet_map_ipv4_dl_csum_trailer(), if the sum of the trailer checksum and the pseudo checksum is non-zero, checksum validation has failed. We
net: qualcomm: rmnet: return earlier for bad checksum
In rmnet_map_ipv4_dl_csum_trailer(), if the sum of the trailer checksum and the pseudo checksum is non-zero, checksum validation has failed. We can return an error as soon as we know that.
We can do the same thing in rmnet_map_ipv6_dl_csum_trailer().
Add some comments that explain where we're headed.
Signed-off-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|