Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7bca61f5
Commit
7bca61f5
authored
Nov 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/ServerSocket: don't abort if IPv6 is not available
First check if an IPv6 socket can be created.
parent
ecf12a60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
NEWS
NEWS
+1
-0
ServerSocket.cxx
src/event/ServerSocket.cxx
+19
-1
No files found.
NEWS
View file @
7bca61f5
...
...
@@ -4,6 +4,7 @@ ver 0.18.1 (2013/11/??)
* networking:
- log UNIX domain path names instead of "localhost"
- open listener sockets in the order they were configured
- don't abort if IPv6 is not available
* filter:
- autoconvert: fix "volume_normalization" with mp3 files
* add missing files to source tarball
...
...
src/event/ServerSocket.cxx
View file @
7bca61f5
...
...
@@ -339,6 +339,7 @@ ServerSocket::AddPortIPv4(unsigned port)
}
#ifdef HAVE_IPV6
inline
void
ServerSocket
::
AddPortIPv6
(
unsigned
port
)
{
...
...
@@ -349,6 +350,22 @@ ServerSocket::AddPortIPv6(unsigned port)
AddAddress
((
const
sockaddr
&
)
sin
,
sizeof
(
sin
));
}
/**
* Is IPv6 supported by the kernel?
*/
gcc_pure
static
bool
SupportsIPv6
()
{
int
fd
=
socket
(
AF_INET6
,
SOCK_STREAM
,
0
);
if
(
fd
<
0
)
return
false
;
close
(
fd
);
return
true
;
}
#endif
/* HAVE_IPV6 */
#endif
/* HAVE_TCP */
...
...
@@ -363,7 +380,8 @@ ServerSocket::AddPort(unsigned port, Error &error)
}
#ifdef HAVE_IPV6
AddPortIPv6
(
port
);
if
(
SupportsIPv6
())
AddPortIPv6
(
port
);
#endif
AddPortIPv4
(
port
);
...
...
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