Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
belle-sip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
belle-sip
Commits
276d1e31
Commit
276d1e31
authored
Jun 08, 2016
by
jehan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
because of field sin6_scope_id, memcmp is not reliable to compare struct sockaddr_in6
parent
ba18f8f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
channel.c
src/channel.c
+3
-13
No files found.
src/channel.c
View file @
276d1e31
...
...
@@ -791,7 +791,7 @@ int belle_sip_channel_matches(const belle_sip_channel_t *obj, const belle_sip_ho
return
1
;
}
if
(
addr
&&
obj
->
current_peer
)
return
addr
->
ai_addrlen
==
obj
->
current_peer
->
ai_addrlen
&&
memcmp
(
addr
->
ai_addr
,
obj
->
current_peer
->
ai_addr
,
addr
->
ai_addrlen
)
==
0
;
return
bctbx_sockaddr_equals
(
addr
->
ai_addr
,
obj
->
current_peer
->
ai_addr
)
;
return
0
;
}
...
...
@@ -1474,18 +1474,8 @@ belle_sip_channel_t *belle_sip_channel_find_from_list_with_addrinfo(belle_sip_li
/* search a matching channel from a list according to supplied hop. The ai_family tells which address family is supported by the list of channels*/
belle_sip_channel_t
*
belle_sip_channel_find_from_list
(
belle_sip_list_t
*
l
,
int
ai_family
,
const
belle_sip_hop_t
*
hop
){
struct
addrinfo
*
res
=
NULL
;
struct
addrinfo
hints
=
{
0
};
char
portstr
[
20
];
belle_sip_channel_t
*
chan
;
hints
.
ai_family
=
ai_family
;
hints
.
ai_flags
=
AI_NUMERICHOST
|
AI_NUMERICSERV
;
hints
.
ai_socktype
=
SOCK_STREAM
;
// needed on some platforms that return an error otherwise (QNX)
if
(
ai_family
==
AF_INET6
)
hints
.
ai_flags
|=
AI_V4MAPPED
|
AI_ALL
;
snprintf
(
portstr
,
sizeof
(
portstr
),
"%i"
,
hop
->
port
);
bctbx_getaddrinfo
(
hop
->
host
,
portstr
,
&
hints
,
&
res
);
belle_sip_channel_t
*
chan
=
NULL
;
struct
addrinfo
*
res
=
bctbx_ip_address_to_addrinfo
(
ai_family
,
SOCK_STREAM
/*needed on some platforms that return an error otherwise (QNX)*/
,
hop
->
host
,
hop
->
port
);
chan
=
belle_sip_channel_find_from_list_with_addrinfo
(
l
,
hop
,
res
);
if
(
res
)
bctbx_freeaddrinfo
(
res
);
return
chan
;
...
...
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