mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-22 16:02:31 +02:00
Add missing support for IPv6 link local addresses (which include % followed by the interface name)
This commit is contained in:
@@ -796,6 +796,8 @@ int zmq::socket_base_t::connect (const char *addr_)
|
||||
// Do some basic sanity checks on tcp:// address syntax
|
||||
// - hostname starts with digit or letter, with embedded '-' or '.'
|
||||
// - IPv6 address may contain hex chars and colons.
|
||||
// - IPv6 link local address may contain % followed by interface name / zone_id
|
||||
// (Reference: https://tools.ietf.org/html/rfc4007)
|
||||
// - IPv4 address may contain decimal digits and dots.
|
||||
// - Address must end in ":port" where port is *, or numeric
|
||||
// - Address may contain two parts separated by ':'
|
||||
@@ -806,8 +808,8 @@ int zmq::socket_base_t::connect (const char *addr_)
|
||||
check++;
|
||||
while (isalnum (*check)
|
||||
|| isxdigit (*check)
|
||||
|| *check == '.' || *check == '-' || *check == ':'|| *check == ';'
|
||||
|| *check == ']')
|
||||
|| *check == '.' || *check == '-' || *check == ':' || *check == '%'
|
||||
|| *check == ';' || *check == ']')
|
||||
check++;
|
||||
}
|
||||
// Assume the worst, now look for success
|
||||
|
Reference in New Issue
Block a user