Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
174552e3
Commit
174552e3
authored
Oct 26, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid inet_ntop(3), use VTC_name() instead.
parent
2f4e3f5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
27 deletions
+7
-27
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+7
-27
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
174552e3
...
...
@@ -31,10 +31,6 @@
#include "config.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -47,6 +43,8 @@
#include "vcl.h"
#include "vrt.h"
#include "vrt_obj.h"
#include "vsa.h"
#include "vtcp.h"
#include "vtim.h"
const
void
*
const
vrt_magic_string_end
=
&
vrt_magic_string_end
;
...
...
@@ -301,31 +299,13 @@ char *
VRT_IP_string
(
const
struct
vrt_ctx
*
ctx
,
const
VCL_IP
ip
)
{
char
*
p
;
const
struct
sockaddr
*
sa
;
const
struct
sockaddr_in
*
si4
;
const
struct
sockaddr_in6
*
si6
;
const
void
*
addr
;
int
len
;
unsigned
len
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
sa
=
ip
;
switch
(
sa
->
sa_family
)
{
case
AF_INET
:
len
=
INET_ADDRSTRLEN
;
si4
=
ip
;
addr
=
&
(
si4
->
sin_addr
);
break
;
case
AF_INET6
:
len
=
INET6_ADDRSTRLEN
;
si6
=
ip
;
addr
=
&
(
si6
->
sin6_addr
);
break
;
default:
INCOMPL
();
}
XXXAN
(
len
);
AN
(
p
=
WS_Alloc
(
ctx
->
ws
,
len
));
AN
(
inet_ntop
(
sa
->
sa_family
,
addr
,
p
,
len
));
len
=
WS_Reserve
(
ctx
->
ws
,
0
);
p
=
ctx
->
ws
->
r
;
VTCP_name
(
ip
,
VSA_Len
(
ip
),
p
,
len
,
NULL
,
0
);
WS_Release
(
ctx
->
ws
,
strlen
(
p
)
+
1
);
return
(
p
);
}
...
...
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