lib/socket-util.c
/* Parses 'target', which may be an IPv4 address or an IPv6 address
 * enclosed in square brackets.
 *
 * On success, returns true and stores the parsed remote address into '*ss'.
 * On failure, logs an error, stores zeros into '*ss', and returns false. */
Parses 'target', which may be an IPv4 address or an IPv6 address
enclosed in square brackets.

On success, returns true and stores the parsed remote address into '*ss'.
On failure, logs an error, stores zeros into '*ss', and returns false.
Parses ' target ' which may be an IPv4 address or an IPv6 address enclosed in square brackets . On success returns true and stores the parsed remote address into ' * ss ' . On failure logs an error stores zeros into ' * ss ' and returns false .
bool
inet_parse_address(const char *target_, struct sockaddr_storage *ss)
{
    char *target = xstrdup(target_);
    char *host = unbracket(target);
    bool ok = parse_sockaddr_components(ss, host, NULL, 0, target_, false);
    if (!ok) {
        memset(ss, 0, sizeof *ss);
    }
    free(target);
    return ok;
}
bool inet_parse_address ( const char * target_ , struct sockaddr_storage * ss ) { char * target = xstrdup ( target_ ) ; char * host = unbracket ( target ) ; bool ok = parse_sockaddr_components ( ss , host , NULL , 0 , target_ , false ) ; if ( ! ok ) { memset ( ss , 0 , sizeof * ss ) ; } free ( target ) ; return ok ; }
Parses 'target', which may be an IPv4 address or an IPv6 address
 enclosed in square brackets.
Parses ' target ' which may be an IPv4 address or an IPv6 address enclosed in square brackets .