From 0b043300dbade23ce9435b7dd308473fea41e6fe Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 11 Apr 2018 11:12:21 -0700 Subject: Make : parsing uniform treewide. I didn't realize until now that the tree had two different ways of parsing strings in the form : and :. There are the long-standing inet_parse_active() and inet_parse_passive() functions, and more recently the ipv46_parse() function. This commit eliminates the latter and changes the code to use the former. The two implementations interpreted some input differently. In particular, the older functions required IPv6 addresses to be [bracketed], but the newer ones do not. For compatibility this patch changes the merged code to use the more liberal interpretation. Signed-off-by: Ben Pfaff Acked-by: Mark Michelson --- ovsdb/raft.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ovsdb') diff --git a/ovsdb/raft.c b/ovsdb/raft.c index edb22f2e7..c0c1e9897 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -335,9 +335,8 @@ raft_make_address_passive(const char *address_) return xasprintf("p%s", address_); } else { char *address = xstrdup(address_); - char *p = strchr(address, ':') + 1; - char *host = inet_parse_token(&p); - char *port = inet_parse_token(&p); + char *host, *port; + inet_parse_host_port_tokens(strchr(address, ':') + 1, &host, &port); struct ds paddr = DS_EMPTY_INITIALIZER; ds_put_format(&paddr, "p%.3s:%s:", address, port); -- cgit v1.2.1