diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index f6436e62c..2f54cb714 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -284,7 +284,7 @@ static bool streams_parse_func(char **a, void **ret, void *p) { SP_SET(sp, RECV); sp->protocol = &transport_protocols[PROTO_UNKNOWN]; - if (endpoint_parse_port_any(&sp->rtp_endpoint, a[0], atoi(a[1]))) + if (!endpoint_parse_port_any(&sp->rtp_endpoint, a[0], atoi(a[1]))) goto fail; sp->index = ++(*i); diff --git a/lib/socket.h b/lib/socket.h index 4fabe8391..42320d4f5 100644 --- a/lib/socket.h +++ b/lib/socket.h @@ -309,11 +309,11 @@ INLINE sockfamily_t *get_socket_family_enum(enum socket_families i) { return NULL; return __get_socket_family_enum(i); } -INLINE int endpoint_parse_port_any(endpoint_t *e, const char *p, unsigned int port) { +INLINE bool endpoint_parse_port_any(endpoint_t *e, const char *p, unsigned int port) { if (port > 0xffff) - return -1; + return false; e->port = port; - return sockaddr_parse_any(&e->address, p) ? 0 : -1; + return sockaddr_parse_any(&e->address, p); } // address (ip) required INLINE int endpoint_parse_any_full(endpoint_t *d, const char *s) {