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
K
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jonathan Coetzee
Knot Resolver
Commits
8bbeab09
Commit
8bbeab09
authored
May 17, 2017
by
Vladimír Čunát
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command line: specify ports via @ but remain compatible
parent
ccafba8e
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
16 deletions
+23
-16
.travis.yml
.travis.yml
+1
-1
NEWS
NEWS
+1
-0
daemon/bindings.c
daemon/bindings.c
+1
-1
daemon/lua/config.lua
daemon/lua/config.lua
+3
-3
daemon/main.c
daemon/main.c
+7
-4
doc/kresd.8.in
doc/kresd.8.in
+3
-3
modules/graphite/graphite.lua
modules/graphite/graphite.lua
+1
-1
modules/http/http.lua
modules/http/http.lua
+1
-1
scripts/supervisor.py
scripts/supervisor.py
+5
-2
No files found.
.travis.yml
View file @
8bbeab09
...
...
@@ -33,7 +33,7 @@ script:
-
CFLAGS="-O2 -g -fno-omit-frame-pointer -DDEBUG" make -j2 install check V=1 COVERAGE=1 PREFIX=${HOME}/.local DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
-
./daemon/kresd -h
-
./daemon/kresd -V
-
echo "quit()" | ./daemon/kresd -a 127.0.0.1
#
53535 .
-
echo "quit()" | ./daemon/kresd -a 127.0.0.1
@
53535 .
-
CFLAGS="-O2 -g -fno-omit-frame-pointer -DDEBUG" make -j2 check-integration COVERAGE=1 PREFIX=${HOME}/.local DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
after_success
:
-
if test $TRAVIS_OS_NAME = linux; then coveralls -i lib -i daemon -x ".c" --gcov-options '\-lp'; fi
...
...
NEWS
View file @
8bbeab09
...
...
@@ -11,6 +11,7 @@ Security
Improvements
------------
- allow answering from cache in non-iterative modes (#122)
- command line: specify ports via @ but still support # for compatibility
Knot Resolver 1.2.6 (2017-04-24)
...
...
daemon/bindings.c
View file @
8bbeab09
...
...
@@ -189,7 +189,7 @@ static int net_listen_addrs(lua_State *L, int port, int flags)
struct
engine
*
engine
=
engine_luaget
(
L
);
int
ret
=
network_listen
(
&
engine
->
net
,
str
,
port
,
flags
);
if
(
ret
!=
0
)
{
kr_log_info
(
"[system] bind to '%s
#
%d' %s
\n
"
,
kr_log_info
(
"[system] bind to '%s
@
%d' %s
\n
"
,
str
,
port
,
kr_strerror
(
ret
));
}
return
ret
==
0
;
...
...
daemon/lua/config.lua
View file @
8bbeab09
...
...
@@ -2,12 +2,12 @@
if
not
next
(
net
.
list
())
then
local
ok
,
err
=
pcall
(
net
.
listen
,
'127.0.0.1'
)
if
not
ok
then
error
(
'bind to 127.0.0.1
#
53 '
..
err
)
error
(
'bind to 127.0.0.1
@
53 '
..
err
)
end
-- IPv6 loopback may fail
ok
,
err
=
pcall
(
net
.
listen
,
'::1'
)
if
not
ok
and
verbose
()
then
print
(
'bind to ::1
#
53 '
..
err
)
print
(
'bind to ::1
@
53 '
..
err
)
end
end
-- Open cache if not set/disabled
...
...
daemon/main.c
View file @
8bbeab09
...
...
@@ -289,7 +289,10 @@ static void signal_handler(uv_signal_t *handle, int signum)
/** Split away port from the address. */
static
const
char
*
set_addr
(
char
*
addr
,
int
*
port
)
{
char
*
p
=
strchr
(
addr
,
'#'
);
char
*
p
=
strchr
(
addr
,
'@'
);
if
(
!
p
)
{
p
=
strchr
(
addr
,
'#'
);
}
if
(
p
)
{
*
port
=
atoi
(
p
+
1
);
*
p
=
'\0'
;
...
...
@@ -338,7 +341,7 @@ static void help(int argc, char *argv[])
{
printf
(
"Usage: %s [parameters] [rundir]
\n
"
,
argv
[
0
]);
printf
(
"
\n
Parameters:
\n
"
" -a, --addr=[addr] Server address (default: localhost
#
53).
\n
"
" -a, --addr=[addr] Server address (default: localhost
@
53).
\n
"
" -t, --tls=[addr] Server address for TLS (default: off).
\n
"
" -S, --fd=[fd] Listen on given fd (handed out by supervisor).
\n
"
" -T, --tlsfd=[fd] Listen using TLS on given fd (handed out by supervisor).
\n
"
...
...
@@ -609,7 +612,7 @@ int main(int argc, char **argv)
const
char
*
addr
=
set_addr
(
addr_set
.
at
[
i
],
&
port
);
ret
=
network_listen
(
&
engine
.
net
,
addr
,
(
uint16_t
)
port
,
NET_UDP
|
NET_TCP
);
if
(
ret
!=
0
)
{
kr_log_error
(
"[system] bind to '%s
#
%d' %s
\n
"
,
addr
,
port
,
kr_strerror
(
ret
));
kr_log_error
(
"[system] bind to '%s
@
%d' %s
\n
"
,
addr
,
port
,
kr_strerror
(
ret
));
ret
=
EXIT_FAILURE
;
break
;
}
...
...
@@ -622,7 +625,7 @@ int main(int argc, char **argv)
const
char
*
addr
=
set_addr
(
tls_set
.
at
[
i
],
&
port
);
ret
=
network_listen
(
&
engine
.
net
,
addr
,
(
uint16_t
)
port
,
NET_TCP
|
NET_TLS
);
if
(
ret
!=
0
)
{
kr_log_error
(
"[system] bind to '%s
#
%d' (TLS) %s
\n
"
,
addr
,
port
,
kr_strerror
(
ret
));
kr_log_error
(
"[system] bind to '%s
@
%d' (TLS) %s
\n
"
,
addr
,
port
,
kr_strerror
(
ret
));
ret
=
EXIT_FAILURE
;
break
;
}
...
...
doc/kresd.8.in
View file @
8bbeab09
...
...
@@ -13,7 +13,7 @@
.SH "SYNOPSIS"
.B kresd
.RB [ \-a | \-\-addr
.IR addr[
#
port] ]
.IR addr[
@
port] ]
.RB [ \-S | \-\-fd
.IR fd ]
.RB [ \-c | \-\-config
...
...
@@ -92,11 +92,11 @@ EOF
.P
The available CLI options are:
.TP
.B \-a\fI addr[
#port]\fR, \fB\-\-addr=\fI<addr[#
port]>
.B \-a\fI addr[
@port]\fR, \fB\-\-addr=\fI<addr[@
port]>
Listen on given address (and port) pair. If no port is given, \fI53\fR is used as a default.
Option may be passed multiple times to listen on more addresses.
.TP
.B \-t\fI addr[
#port]\fR, \fB\-\-tls=\fI<addr[#
port]>
.B \-t\fI addr[
@port]\fR, \fB\-\-tls=\fI<addr[@
port]>
Listen using TLS on given address (and port) pair. If no port is
given, \fI853\fR is used as a default. Option may be passed multiple
times to listen on more addresses.
...
...
modules/graphite/graphite.lua
View file @
8bbeab09
...
...
@@ -66,7 +66,7 @@ local function publish_table(metrics, prefix, now)
local
tcp
=
M
.
cli
[
i
][
'connect'
]
~=
nil
local
host
=
M
.
info
[
i
]
if
tcp
and
host
.
seen
+
2
*
M
.
interval
/
1000
<=
now
then
print
(
string.format
(
'[graphite] reconnecting: %s
#
%d reason: %s'
,
print
(
string.format
(
'[graphite] reconnecting: %s
@
%d reason: %s'
,
host
.
addr
,
host
.
port
,
err
))
M
.
cli
[
i
]
=
make_tcp
(
host
.
addr
,
host
.
port
)
host
.
seen
=
now
...
...
modules/http/http.lua
View file @
8bbeab09
...
...
@@ -303,7 +303,7 @@ function M.interface(host, port, endpoints, crtfile, keyfile)
onstream
=
routes
;
}
if
not
s
then
panic
(
'failed to listen on %s
#
%d: %s'
,
host
,
port
,
err
)
panic
(
'failed to listen on %s
@
%d: %s'
,
host
,
port
,
err
)
end
table.insert
(
M
.
servers
,
s
)
-- Create certificate renewal timer if ephemeral
...
...
scripts/supervisor.py
View file @
8bbeab09
...
...
@@ -27,7 +27,10 @@ while len(unparsed) > 0:
# Parse address
addr
=
unparsed
.
pop
(
0
)
try
:
if
'#'
in
addr
:
if
'@'
in
addr
:
addr
,
port
=
addr
.
split
(
'@'
)
port
=
int
(
port
)
elif
'#'
in
addr
:
addr
,
port
=
addr
.
split
(
'#'
)
port
=
int
(
port
)
else
:
...
...
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