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
94092f1f
Commit
94092f1f
authored
Aug 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/SocketAddress: reimplement IsV6Any() using IPv6Address::IsAny()
parent
a84b83f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
SocketAddress.cxx
src/net/SocketAddress.cxx
+3
-4
No files found.
src/net/SocketAddress.cxx
View file @
94092f1f
...
...
@@ -29,6 +29,7 @@
#include "config.h"
#include "SocketAddress.hxx"
#include "IPv6Address.hxx"
#include "util/StringView.hxx"
#include <string.h>
...
...
@@ -78,9 +79,7 @@ SocketAddress::GetLocalRaw() const noexcept
bool
SocketAddress
::
IsV6Any
()
const
noexcept
{
return
GetFamily
()
==
AF_INET6
&&
memcmp
(
&
((
const
struct
sockaddr_in6
*
)(
const
void
*
)
GetAddress
())
->
sin6_addr
,
&
in6addr_any
,
sizeof
(
in6addr_any
))
==
0
;
return
GetFamily
()
==
AF_INET6
&&
IPv6Address
(
*
this
).
IsAny
();
}
unsigned
...
...
@@ -94,7 +93,7 @@ SocketAddress::GetPort() const noexcept
return
ntohs
(((
const
struct
sockaddr_in
*
)(
const
void
*
)
address
)
->
sin_port
);
case
AF_INET6
:
return
ntohs
(((
const
struct
sockaddr_in6
*
)(
const
void
*
)
address
)
->
sin6_port
);
return
IPv6Address
(
*
this
).
GetPort
(
);
default
:
return
0
;
...
...
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