public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v2 6/6] tcp: Correct function comments for address types
Date: Fri,  4 Nov 2022 14:10:37 +1100	[thread overview]
Message-ID: <20221104031037.3866034-7-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20221104031037.3866034-1-david@gibson.dropbear.id.au>

A number of functions describe themselves as taking a pointer to 'sin_addr
or sin6_addr'.  Those are field names, not type names.  Replace them with
the correct type names, in_addr or in6_addr.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 tcp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tcp.c b/tcp.c
index 7405ba9..713248f 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1277,7 +1277,7 @@ static int tcp_opt_get(const char *opts, size_t len, uint8_t type_find,
  * tcp_hash_match() - Check if a connection entry matches address and ports
  * @conn:	Connection entry to match against
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -1303,7 +1303,7 @@ static int tcp_hash_match(const struct tcp_conn *conn, int af, const void *addr,
  * tcp_hash() - Calculate hash value for connection given address and ports
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -1347,7 +1347,7 @@ static unsigned int tcp_hash(const struct ctx *c, int af, const void *addr,
  * @c:		Execution context
  * @conn:	Connection pointer
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  */
 static void tcp_hash_insert(const struct ctx *c, struct tcp_conn *conn,
 			    int af, const void *addr)
@@ -1418,7 +1418,7 @@ static void tcp_hash_update(struct tcp_conn *old, struct tcp_conn *new)
  * tcp_hash_lookup() - Look up connection given remote address and ports
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -2026,7 +2026,7 @@ static void tcp_clamp_window(const struct ctx *c, struct tcp_conn *conn,
  * tcp_seq_init() - Calculate initial sequence number according to RFC 6528
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @dstport:	Destination port, connection-wise, network order
  * @srcport:	Source port, connection-wise, network order
  * @now:	Current timestamp
@@ -2144,7 +2144,7 @@ static uint16_t tcp_conn_tap_mss(const struct ctx *c,
  * tcp_conn_from_tap() - Handle connection request (SYN segment) from tap
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @th:		TCP header from tap: caller MUST ensure it's there
  * @opts:	Pointer to start of options
  * @optlen:	Bytes in options: caller MUST ensure available length
-- 
@@ -1277,7 +1277,7 @@ static int tcp_opt_get(const char *opts, size_t len, uint8_t type_find,
  * tcp_hash_match() - Check if a connection entry matches address and ports
  * @conn:	Connection entry to match against
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -1303,7 +1303,7 @@ static int tcp_hash_match(const struct tcp_conn *conn, int af, const void *addr,
  * tcp_hash() - Calculate hash value for connection given address and ports
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -1347,7 +1347,7 @@ static unsigned int tcp_hash(const struct ctx *c, int af, const void *addr,
  * @c:		Execution context
  * @conn:	Connection pointer
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  */
 static void tcp_hash_insert(const struct ctx *c, struct tcp_conn *conn,
 			    int af, const void *addr)
@@ -1418,7 +1418,7 @@ static void tcp_hash_update(struct tcp_conn *old, struct tcp_conn *new)
  * tcp_hash_lookup() - Look up connection given remote address and ports
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @tap_port:	tap-facing port
  * @sock_port:	Socket-facing port
  *
@@ -2026,7 +2026,7 @@ static void tcp_clamp_window(const struct ctx *c, struct tcp_conn *conn,
  * tcp_seq_init() - Calculate initial sequence number according to RFC 6528
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @dstport:	Destination port, connection-wise, network order
  * @srcport:	Source port, connection-wise, network order
  * @now:	Current timestamp
@@ -2144,7 +2144,7 @@ static uint16_t tcp_conn_tap_mss(const struct ctx *c,
  * tcp_conn_from_tap() - Handle connection request (SYN segment) from tap
  * @c:		Execution context
  * @af:		Address family, AF_INET or AF_INET6
- * @addr:	Remote address, pointer to sin_addr or sin6_addr
+ * @addr:	Remote address, pointer to in_addr or in6_addr
  * @th:		TCP header from tap: caller MUST ensure it's there
  * @opts:	Pointer to start of options
  * @optlen:	Bytes in options: caller MUST ensure available length
-- 
2.38.1


      parent reply	other threads:[~2022-11-04  3:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  3:10 [PATCH v2 0/6] Improve IPv4 address endian handling and related bug fixes David Gibson
2022-11-04  3:10 ` [PATCH v2 1/6] Correct some missing endian conversions of IPv4 addresses David Gibson
2022-11-04  3:10 ` [PATCH v2 2/6] Minor improvements to IPv4 netmask handling David Gibson
2022-11-04  3:10 ` [PATCH v2 3/6] Use IPV4_IS_LOOPBACK more widely David Gibson
2022-11-04  3:10 ` [PATCH v2 4/6] Use typing to reduce chances of IPv4 endianness errors David Gibson
2022-11-04  3:10 ` [PATCH v2 5/6] Use endian-safer typing in struct tap4_l4_t David Gibson
2022-11-04  3:10 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221104031037.3866034-7-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).