diff mbox series

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

Message ID 1524687102-24603-1-git-send-email-dlu998@gmail.com
State Accepted
Headers show
Series [ovs-dev,v1] socket-util: Elaborate inet_parse_active comment. | expand

Commit Message

Darrell Ball April 25, 2018, 8:11 p.m. UTC
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@gmail.com>
---
 lib/socket-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ben Pfaff May 9, 2018, 9:19 p.m. UTC | #1
On Wed, Apr 25, 2018 at 01:11:42PM -0700, Darrell Ball wrote:
> 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@gmail.com>

Thanks, applied.  I rephrased it a bit.
Darrell Ball May 9, 2018, 9:38 p.m. UTC | #2
On 5/9/18, 2:19 PM, "ovs-dev-bounces@openvswitch.org on behalf of Ben Pfaff" <ovs-dev-bounces@openvswitch.org on behalf of blp@ovn.org> wrote:

    On Wed, Apr 25, 2018 at 01:11:42PM -0700, Darrell Ball wrote:
    > 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@gmail.com>
    
    Thanks, applied.  I rephrased it a bit.

cool, thanks

    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=tKTLoAXtuqDeHSMS_GOtKvaMJTWtma1PkgH4_3gNEF8&s=uyATpDOJ31QB7dDXgzs_JZ8Uf-sNhOqYL0ZRkGkbsaE&e=
diff mbox series

Patch

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. */