Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
radsecproxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
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
eduroam
radsecproxy
Commits
633e4b83
Commit
633e4b83
authored
Jul 30, 2017
by
Linus Nordberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check return value from setsockopt().
coverity: 1449508, 1449522.
parent
8aef6cf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
radsecproxy.c
radsecproxy.c
+4
-2
util.c
util.c
+4
-2
No files found.
radsecproxy.c
View file @
633e4b83
...
...
@@ -2014,13 +2014,15 @@ void createlistener(uint8_t type, char *arg) {
debugerrno
(
errno
,
DBG_WARN
,
"createlistener: socket failed"
);
continue
;
}
setsockopt
(
s
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
on
,
sizeof
(
on
));
if
(
setsockopt
(
s
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
on
,
sizeof
(
on
))
==
-
1
)
debugerrno
(
errno
,
DBG_WARN
,
"createlistener: SO_REUSEADDR"
);
disable_DF_bit
(
s
,
res
);
#ifdef IPV6_V6ONLY
if
(
res
->
ai_family
==
AF_INET6
)
setsockopt
(
s
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
on
,
sizeof
(
on
));
if
(
setsockopt
(
s
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
on
,
sizeof
(
on
))
==
-
1
)
debugerrno
(
errno
,
DBG_WARN
,
"createlistener: IPV6_V6ONLY"
);
#endif
if
(
bind
(
s
,
res
->
ai_addr
,
res
->
ai_addrlen
))
{
debugerrno
(
errno
,
DBG_WARN
,
"createlistener: bind failed"
);
...
...
util.c
View file @
633e4b83
...
...
@@ -150,10 +150,12 @@ int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only) {
disable_DF_bit
(
s
,
res
);
if
(
reuse
)
setsockopt
(
s
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
on
,
sizeof
(
on
));
if
(
setsockopt
(
s
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
on
,
sizeof
(
on
))
==
-
1
)
debugerrno
(
errno
,
DBG_WARN
,
"Failed to set SO_REUSEADDR"
);
#ifdef IPV6_V6ONLY
if
(
v6only
)
setsockopt
(
s
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
on
,
sizeof
(
on
));
if
(
setsockopt
(
s
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
on
,
sizeof
(
on
))
==
-
1
)
debugerrno
(
errno
,
DBG_WARN
,
"Failed to set IPV6_V6ONLY"
);
#endif
if
(
!
bind
(
s
,
res
->
ai_addr
,
res
->
ai_addrlen
))
return
s
;
...
...
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