Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
db9c2ca6
Commit
db9c2ca6
authored
May 05, 2020
by
Olivier Crête
Committed by
Olivier Crête
May 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: Use union for sockaddr/sockaddr_in
This makes clang happy Fixes #100
parent
ac3f7b5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
agent/interfaces.c
agent/interfaces.c
+11
-7
No files found.
agent/interfaces.c
View file @
db9c2ca6
...
...
@@ -269,7 +269,11 @@ get_local_ips_ioctl (gboolean include_loopback)
gint
size
=
0
;
struct
ifreq
*
ifr
;
struct
ifconf
ifc
;
struct
sockaddr_in
*
sa
;
union
{
struct
sockaddr_in
*
sin
;
struct
sockaddr
*
sa
;
}
sa
;
GList
*
loopbacks
=
NULL
;
#ifdef IGNORED_IFACE_PREFIX
const
gchar
**
prefix
;
...
...
@@ -324,12 +328,12 @@ get_local_ips_ioctl (gboolean include_loopback)
if
((
ifr
->
ifr_flags
&
IFF_RUNNING
)
==
0
)
continue
;
sa
=
(
struct
sockaddr_in
*
)
&
ifr
->
ifr_addr
;
sa
.
sa
=
&
ifr
->
ifr_addr
;
nice_debug
(
"Interface: %s"
,
ifr
->
ifr_name
);
nice_debug
(
"IP Address: %s"
,
inet_ntoa
(
sa
->
sin_addr
));
nice_debug
(
"IP Address: %s"
,
inet_ntoa
(
sa
.
sin
->
sin_addr
));
if
((
ifr
->
ifr_flags
&
IFF_LOOPBACK
)
==
IFF_LOOPBACK
){
if
(
include_loopback
)
loopbacks
=
add_ip_to_list
(
loopbacks
,
g_strdup
(
inet_ntoa
(
sa
->
sin_addr
)),
TRUE
);
loopbacks
=
add_ip_to_list
(
loopbacks
,
g_strdup
(
inet_ntoa
(
sa
.
sin
->
sin_addr
)),
TRUE
);
else
nice_debug
(
"Ignoring loopback interface"
);
continue
;
...
...
@@ -350,10 +354,10 @@ get_local_ips_ioctl (gboolean include_loopback)
continue
;
#endif
if
(
nice_interfaces_is_private_ip
(
(
struct
sockaddr
*
)
sa
))
{
ips
=
add_ip_to_list
(
ips
,
g_strdup
(
inet_ntoa
(
sa
->
sin_addr
)),
TRUE
);
if
(
nice_interfaces_is_private_ip
(
sa
.
sa
))
{
ips
=
add_ip_to_list
(
ips
,
g_strdup
(
inet_ntoa
(
sa
.
sin
->
sin_addr
)),
TRUE
);
}
else
{
ips
=
add_ip_to_list
(
ips
,
g_strdup
(
inet_ntoa
(
sa
->
sin_addr
)),
FALSE
);
ips
=
add_ip_to_list
(
ips
,
g_strdup
(
inet_ntoa
(
sa
.
sin
->
sin_addr
)),
FALSE
);
}
}
...
...
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