From aa59777f998104cab837e327a7c7682c76f5b4a1 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 17 Dec 2019 12:52:10 +0900 Subject: [PATCH] Fix create_id_easy not parsing ipv4 addr correctly --- src/UDPConnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UDPConnection.cpp b/src/UDPConnection.cpp index d754b35..60a7ecb 100644 --- a/src/UDPConnection.cpp +++ b/src/UDPConnection.cpp @@ -1702,7 +1702,8 @@ UDPC_ConnectionId UDPC_create_id_anyaddr(uint16_t port) { UDPC_ConnectionId UDPC_create_id_easy(const char *addrString, uint16_t port) { UDPC_ConnectionId conId{{0}, 0, port}; - if(std::regex_match(addrString, ipv6_regex_nolink)) { + if(std::regex_match(addrString, ipv6_regex_nolink) + || std::regex_match(addrString, ipv4_regex)) { conId.addr = UDPC_strtoa(addrString); } else if(std::regex_match(addrString, ipv6_regex_linkonly)) { conId.addr = UDPC_strtoa_link(addrString, &conId.scope_id);