Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Icecast-libshout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-libshout
Commits
c60cb1be
Commit
c60cb1be
authored
Feb 14, 2003
by
Michael Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting of ip addresses so that v6 sockets are logged correctly.
svn path=/trunk/net/; revision=4345
parent
e8f1cad8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/net/sock.c
src/net/sock.c
+9
-5
No files found.
src/net/sock.c
View file @
c60cb1be
...
...
@@ -668,15 +668,19 @@ int sock_accept(sock_t serversock, char *ip, int len)
ret
=
accept
(
serversock
,
(
struct
sockaddr
*
)
&
sa
,
&
slen
);
if
(
ret
>=
0
&&
ip
!=
NULL
)
{
/* inet_ntoa is not reentrant, we should protect this */
#ifdef HAVE_IPV6
if
(
inet_ntop
(
AF_INET
,
&
((
struct
sockaddr_in
*
)
&
sa
)
->
sin_addr
,
ip
,
len
)
<=
0
)
{
inet_ntop
(
AF_INET6
,
&
((
struct
sockaddr_in6
*
)
&
sa
)
->
sin6_addr
,
if
(((
struct
sockaddr_in
*
)
&
sa
)
->
sin_family
==
AF_INET
)
inet_ntop
(
AF_INET
,
&
((
struct
sockaddr_in
*
)
&
sa
)
->
sin_addr
,
ip
,
len
);
else
if
(((
struct
sockaddr_in6
*
)
&
sa
)
->
sin6_family
==
AF_INET6
)
inet_ntop
(
AF_INET6
,
&
((
struct
sockaddr_in6
*
)
&
sa
)
->
sin6_addr
,
ip
,
len
);
else
{
strncpy
(
ip
,
"ERROR"
,
len
-
1
);
ip
[
len
-
1
]
=
0
;
}
#else
/* inet_ntoa is not reentrant, we should protect this */
strncpy
(
ip
,
inet_ntoa
(
sa
.
sin_addr
),
len
);
#endif
sock_set_nolinger
(
ret
);
...
...
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