[ovs-dev] [patch v1] socket-util: Elaborate inet_parse_active comment.

Darrell Ball dlu998 at gmail.com
Wed Apr 25 20:11:42 UTC 2018


The function inet_parse_active() is an external API and used
as one stop shopping for parsing ip address and L4 port
combinations from many other modules.  Hence, the function
header is extended to describe the special cases that it
handles.

Signed-off-by: Darrell Ball <dlu998 at gmail.com>
---
 lib/socket-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 1071a32..22b2f04 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -483,7 +483,11 @@ exit:
 /* Parses 'target', which should be a string in the format "<host>[:<port>]".
  * <host>, which is required, may be an IPv4 address or an IPv6 address
  * enclosed in square brackets.  If 'default_port' is nonnegative then <port>
- * is optional and defaults to 'default_port'.
+ * is optional and defaults to 'default_port'.  In the case where the
+ * default_port is zero, there is no 'default_port' as zero is not a valid
+ * L4 port.  This would be used in the case where a port may or may not be
+ * supplied.  A negative 'default_port' is used to enforce that a port must
+ * be supplied.
  *
  * On success, returns true and stores the parsed remote address into '*ss'.
  * On failure, logs an error, stores zeros into '*ss', and returns false. */
-- 
1.9.1



More information about the dev mailing list