Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
libdvbpsi
Commits
671158b7
Commit
671158b7
authored
Sep 24, 2012
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbinfo: avoid using 'socket' as variable.
parent
b08fbb7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
examples/dvbinfo/udp.c
examples/dvbinfo/udp.c
+6
-6
No files found.
examples/dvbinfo/udp.c
View file @
671158b7
...
@@ -80,7 +80,7 @@ static bool is_multicast(const struct sockaddr *addr, socklen_t len)
...
@@ -80,7 +80,7 @@ static bool is_multicast(const struct sockaddr *addr, socklen_t len)
return
false
;
return
false
;
}
}
static
bool
mcast_connect
(
int
s
ocket
,
const
char
*
interface
,
const
struct
sockaddr
*
addr
,
socklen_t
len
)
static
bool
mcast_connect
(
int
s
,
const
char
*
interface
,
const
struct
sockaddr
*
addr
,
socklen_t
len
)
{
{
unsigned
int
ifindex
=
interface
?
if_nametoindex
(
interface
)
:
0
;
unsigned
int
ifindex
=
interface
?
if_nametoindex
(
interface
)
:
0
;
...
@@ -104,12 +104,12 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
...
@@ -104,12 +104,12 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
assert
(
len
>=
sizeof
(
struct
sockaddr_in6
));
assert
(
len
>=
sizeof
(
struct
sockaddr_in6
));
if
(
sin6
->
sin6_scope_id
!=
0
)
if
(
sin6
->
sin6_scope_id
!=
0
)
greq
.
gr_interface
=
sin6
->
sin6_scope_id
;
greq
.
gr_interface
=
sin6
->
sin6_scope_id
;
if
(
setsockopt
(
s
ocket
,
SOL_IPV6
,
MCAST_JOIN_GROUP
,
&
greq
,
sizeof
(
greq
))
==
0
)
if
(
setsockopt
(
s
,
SOL_IPV6
,
MCAST_JOIN_GROUP
,
&
greq
,
sizeof
(
greq
))
==
0
)
return
true
;
return
true
;
break
;
break
;
}
}
case
AF_INET
:
case
AF_INET
:
if
(
setsockopt
(
s
ocket
,
SOL_IP
,
MCAST_JOIN_GROUP
,
&
greq
,
sizeof
(
greq
))
==
0
)
if
(
setsockopt
(
s
,
SOL_IP
,
MCAST_JOIN_GROUP
,
&
greq
,
sizeof
(
greq
))
==
0
)
return
true
;
return
true
;
break
;
break
;
default:
default:
...
@@ -128,9 +128,9 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
...
@@ -128,9 +128,9 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
ipv6mr
.
ipv6mr_multiaddr
=
ip6
->
sin6_addr
;
ipv6mr
.
ipv6mr_multiaddr
=
ip6
->
sin6_addr
;
ipv6mr
.
ipv6mr_interface
=
(
ifindex
>
0
)
?
ifindex
:
ip6
->
sin6_scope_id
;
ipv6mr
.
ipv6mr_interface
=
(
ifindex
>
0
)
?
ifindex
:
ip6
->
sin6_scope_id
;
# ifdef IPV6_JOIN_GROUP
# ifdef IPV6_JOIN_GROUP
if
(
setsockopt
(
s
ocket
,
SOL_IPV6
,
IPV6_JOIN_GROUP
,
&
ipv6mr
,
sizeof
(
ipv6mr
))
==
0
)
if
(
setsockopt
(
s
,
SOL_IPV6
,
IPV6_JOIN_GROUP
,
&
ipv6mr
,
sizeof
(
ipv6mr
))
==
0
)
# else
# else
if
(
setsockopt
(
s
ocket
,
SOL_IPV6
,
IPV6_ADD_MEMBERSHIP
,
&
ipv6mr
,
sizeof
(
ipv6mr
))
==
0
)
if
(
setsockopt
(
s
,
SOL_IPV6
,
IPV6_ADD_MEMBERSHIP
,
&
ipv6mr
,
sizeof
(
ipv6mr
))
==
0
)
# endif
# endif
return
true
;
return
true
;
break
;
break
;
...
@@ -149,7 +149,7 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
...
@@ -149,7 +149,7 @@ static bool mcast_connect(int socket, const char *interface, const struct sockad
if (ifindex > 0)
if (ifindex > 0)
imr.imr_index = ifindex;
imr.imr_index = ifindex;
#endif
#endif
if
(
setsockopt
(
s
ocket
,
SOL_IP
,
IP_ADD_MEMBERSHIP
,
&
imr
,
sizeof
(
imr
))
==
0
)
if
(
setsockopt
(
s
,
SOL_IP
,
IP_ADD_MEMBERSHIP
,
&
imr
,
sizeof
(
imr
))
==
0
)
return
true
;
return
true
;
break
;
break
;
}
}
...
...
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