Fix create_id_easy not parsing ipv4 addr correctly
This commit is contained in:
parent
58493ee936
commit
aa59777f99
1 changed files with 2 additions and 1 deletions
|
@ -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 UDPC_create_id_easy(const char *addrString, uint16_t port) {
|
||||||
UDPC_ConnectionId conId{{0}, 0, 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);
|
conId.addr = UDPC_strtoa(addrString);
|
||||||
} else if(std::regex_match(addrString, ipv6_regex_linkonly)) {
|
} else if(std::regex_match(addrString, ipv6_regex_linkonly)) {
|
||||||
conId.addr = UDPC_strtoa_link(addrString, &conId.scope_id);
|
conId.addr = UDPC_strtoa_link(addrString, &conId.scope_id);
|
||||||
|
|
Loading…
Reference in a new issue