Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
6a41f278
Commit
6a41f278
authored
Apr 08, 2017
by
Luca Boccassi
Committed by
GitHub
Apr 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2510 from lytboris/ipv6-resolve_nic_name-fix
choose IP(v6) address based on ipv6_ flag in a correct way
parents
ac7d02e7
8bc92bde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
tcp_address.cpp
src/tcp_address.cpp
+3
-5
No files found.
src/tcp_address.cpp
View file @
6a41f278
...
...
@@ -147,7 +147,7 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
}
const
int
family
=
ifr
.
ifr_addr
.
sa_family
;
if
(
(
family
==
AF_INET
||
(
ipv6_
&&
family
==
AF_INET6
)
)
if
(
family
==
(
ipv6_
?
AF_INET6
:
AF_INET
)
&&
!
strcmp
(
nic_
,
ifr
.
ifr_name
))
{
if
(
is_src_
)
...
...
@@ -210,7 +210,7 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
continue
;
const
int
family
=
ifp
->
ifa_addr
->
sa_family
;
if
(
(
family
==
AF_INET
||
(
ipv6_
&&
family
==
AF_INET6
)
)
if
(
family
==
(
ipv6_
?
AF_INET6
:
AF_INET
)
&&
!
strcmp
(
nic_
,
ifp
->
ifa_name
))
{
if
(
is_src_
)
memcpy
(
&
source_address
,
ifp
->
ifa_addr
,
...
...
@@ -338,9 +338,7 @@ int zmq::tcp_address_t::resolve_nic_name(const char *nic_, bool ipv6_, bool is_s
while
(
current_unicast_address
)
{
ADDRESS_FAMILY
family
=
current_unicast_address
->
Address
.
lpSockaddr
->
sa_family
;
if
(
family
==
AF_INET
||
(
ipv6_
&&
family
==
AF_INET6
)
)
{
if
(
family
==
(
ipv6_
?
AF_INET6
:
AF_INET
))
{
if
(
is_src_
)
memcpy
(
&
source_address
,
current_unicast_address
->
Address
.
lpSockaddr
,
(
family
==
AF_INET
)
?
sizeof
(
struct
sockaddr_in
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment