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
fde2d231
Commit
fde2d231
authored
Mar 16, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it a failure to not get all acceptor sockets on child start.
parent
00ce8fcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
mgt_acceptor.c
bin/varnishd/mgt/mgt_acceptor.c
+11
-14
c00003.vtc
bin/varnishtest/tests/c00003.vtc
+1
-1
No files found.
bin/varnishd/mgt/mgt_acceptor.c
View file @
fde2d231
...
...
@@ -33,7 +33,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <
fcntl
.h>
#include <
errno
.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -58,26 +58,23 @@ int
MAC_open_sockets
(
void
)
{
struct
listen_sock
*
ls
;
int
good
=
0
;
int
fail
;
VJ_master
(
JAIL_MASTER_PRIVPORT
);
VTAILQ_FOREACH
(
ls
,
&
heritage
.
socks
,
list
)
{
if
(
ls
->
sock
>=
0
)
{
good
++
;
continue
;
}
assert
(
ls
->
sock
<
0
);
ls
->
sock
=
VTCP_bind
(
ls
->
addr
,
NULL
);
if
(
ls
->
sock
<
0
)
continue
;
break
;
mgt_child_inherit
(
ls
->
sock
,
"sock"
);
good
++
;
}
fail
=
errno
;
VJ_master
(
JAIL_MASTER_LOW
);
if
(
!
good
)
return
(
1
);
return
(
0
);
if
(
ls
==
NULL
)
return
(
0
);
MAC_close_sockets
();
errno
=
fail
;
return
(
-
1
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -158,7 +155,7 @@ MAC_Arg(const char *arg)
mh
->
err
=
&
err
;
error
=
VSS_resolver
(
av
[
1
],
"80"
,
mac_callback
,
mh
,
&
err
);
if
(
mh
->
good
==
0
||
err
!=
NULL
)
ARGV_ERR
(
"Could not
open
%s: %s
\n
"
,
av
[
1
],
err
);
ARGV_ERR
(
"Could not
bind to address
%s: %s
\n
"
,
av
[
1
],
err
);
AZ
(
error
);
FREE_OBJ
(
mh
);
}
bin/varnishtest/tests/c00003.vtc
View file @
fde2d231
...
...
@@ -4,7 +4,7 @@ varnishtest "Check that we fail to start if any listen address does not work"
# and are on Linux, ensure /proc/net/ipv4/ip_nonlocal_bind is set to 0.
# All bad listen addresses
err_shell "Could not
open
192.0.2.255:0" {${varnishd} -F -a "${bad_ip}:0" -b /// -n ${tmpdir} 2>&1 }
err_shell "Could not
bind to address
192.0.2.255:0" {${varnishd} -F -a "${bad_ip}:0" -b /// -n ${tmpdir} 2>&1 }
# Just one bad listen addresses
err_shell "Error: XXX: not yet" {${varnishd} -F -a "127.0.0.1:0,${bad_ip}:0" -b /// -n ${tmpdir} 2>&1 }
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