aboutgitcodebugslistschat
path: root/checksum.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-05-01 16:53:47 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-05-02 16:13:16 +0200
commit1095a7b0c9a150cb488ff5bd5fd74c897dd9236e (patch)
tree6ed45b0641997e440ce18bb7044966937a59ea0b /checksum.c
parent5d37dab012e5d841d9961dec93e1e813d723fdd4 (diff)
downloadpasst-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar.gz
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar.bz2
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar.lz
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar.xz
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.tar.zst
passt-1095a7b0c9a150cb488ff5bd5fd74c897dd9236e.zip
treewide: Remove misleading and redundant endianness notes
In general, it's much less error-prone to have the endianness of values implied by the type, rather than just noting it in comments. We can't always easily avoid it, because C, but we can do so when possible. struct in_addr and in6_addr are always encoded network endian, so noting it explicitly isn't useful. Remove them. In some cases we also have endianness notes on uint8_t parameters, which doesn't make sense: for a single byte endianness is irrelevant. Remove those too. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'checksum.c')
-rw-r--r--checksum.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/checksum.c b/checksum.c
index 9cbe0b2..a5a506c 100644
--- a/checksum.c
+++ b/checksum.c
@@ -117,9 +117,9 @@ uint16_t csum_fold(uint32_t sum)
/**
* csum_ip4_header() - Calculate IPv4 header checksum
* @tot_len: IPv4 payload length (data + IP header, network order)
- * @protocol: Protocol number (network order)
- * @saddr: IPv4 source address (network order)
- * @daddr: IPv4 destination address (network order)
+ * @protocol: Protocol number
+ * @saddr: IPv4 source address
+ * @daddr: IPv4 destination address
*
* Return: 16-bit folded sum of the IPv4 header
*/
@@ -141,9 +141,9 @@ uint16_t csum_ip4_header(uint16_t tot_len, uint8_t protocol,
* proto_ipv4_header_psum() - Calculates the partial checksum of an
* IPv4 header for UDP or TCP
* @tot_len: IPv4 Payload length (host order)
- * @proto: Protocol number (host order)
- * @saddr: Source address (network order)
- * @daddr: Destination address (network order)
+ * @proto: Protocol number
+ * @saddr: Source address
+ * @daddr: Destination address
* Returns: Partial checksum of the IPv4 header
*/
uint32_t proto_ipv4_header_psum(uint16_t tot_len, uint8_t protocol,
@@ -206,9 +206,9 @@ void csum_icmp4(struct icmphdr *icmp4hr, const void *payload, size_t len)
* proto_ipv6_header_psum() - Calculates the partial checksum of an
* IPv6 header for UDP or TCP
* @payload_len: IPv6 payload length (host order)
- * @proto: Protocol number (host order)
- * @saddr: Source address (network order)
- * @daddr: Destination address (network order)
+ * @proto: Protocol number
+ * @saddr: Source address
+ * @daddr: Destination address
* Returns: Partial checksum of the IPv6 header
*/
uint32_t proto_ipv6_header_psum(uint16_t payload_len, uint8_t protocol,