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
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
142
Issues
142
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
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
Knot projects
Knot Resolver
Commits
e67d5eca
Commit
e67d5eca
authored
Jul 07, 2017
by
Vladimír Čunát
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dns64 nitpick: make the query flag "official"
parent
656ccc00
Pipeline
#7894
canceled with stages
in 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
daemon/lua/kres-gen.lua
daemon/lua/kres-gen.lua
+1
-1
lib/rplan.h
lib/rplan.h
+1
-1
modules/dns64/dns64.lua
modules/dns64/dns64.lua
+2
-3
No files found.
daemon/lua/kres-gen.lua
View file @
e67d5eca
...
...
@@ -165,7 +165,7 @@ struct kr_context {
struct kr_zonecut root_hints;
char _stub[];
};
struct query_flag {static const int NO_MINIMIZE = 1; static const int NO_THROTTLE = 2; static const int NO_IPV6 = 4; static const int NO_IPV4 = 8; static const int TCP = 16; static const int RESOLVED = 32; static const int AWAIT_IPV4 = 64; static const int AWAIT_IPV6 = 128; static const int AWAIT_CUT = 256; static const int SAFEMODE = 512; static const int CACHED = 1024; static const int NO_CACHE = 2048; static const int EXPIRING = 4096; static const int ALLOW_LOCAL = 8192; static const int DNSSEC_WANT = 16384; static const int DNSSEC_BOGUS = 32768; static const int DNSSEC_INSECURE = 65536; static const int STUB = 131072; static const int ALWAYS_CUT = 262144; static const int DNSSEC_WEXPAND = 524288; static const int PERMISSIVE = 1048576; static const int STRICT = 2097152; static const int BADCOOKIE_AGAIN = 4194304; static const int CNAME = 8388608; static const int REORDER_RR = 16777216; static const int TRACE = 33554432; static const int NO_0X20 = 67108864; static const int DNSSEC_NODS = 134217728; static const int DNSSEC_OPTOUT = 268435456; static const int NONAUTH = 536870912; static const int FORWARD = 1073741824;};
struct query_flag {static const int NO_MINIMIZE = 1; static const int NO_THROTTLE = 2; static const int NO_IPV6 = 4; static const int NO_IPV4 = 8; static const int TCP = 16; static const int RESOLVED = 32; static const int AWAIT_IPV4 = 64; static const int AWAIT_IPV6 = 128; static const int AWAIT_CUT = 256; static const int SAFEMODE = 512; static const int CACHED = 1024; static const int NO_CACHE = 2048; static const int EXPIRING = 4096; static const int ALLOW_LOCAL = 8192; static const int DNSSEC_WANT = 16384; static const int DNSSEC_BOGUS = 32768; static const int DNSSEC_INSECURE = 65536; static const int STUB = 131072; static const int ALWAYS_CUT = 262144; static const int DNSSEC_WEXPAND = 524288; static const int PERMISSIVE = 1048576; static const int STRICT = 2097152; static const int BADCOOKIE_AGAIN = 4194304; static const int CNAME = 8388608; static const int REORDER_RR = 16777216; static const int TRACE = 33554432; static const int NO_0X20 = 67108864; static const int DNSSEC_NODS = 134217728; static const int DNSSEC_OPTOUT = 268435456; static const int NONAUTH = 536870912; static const int FORWARD = 1073741824;
static const int DNS64_MARK = 2147483648;
};
int knot_dname_size(const knot_dname_t *);
knot_dname_t *knot_dname_from_str(uint8_t *, const char *, size_t);
char *knot_dname_to_str(char *, const knot_dname_t *, size_t);
...
...
lib/rplan.h
View file @
e67d5eca
...
...
@@ -58,7 +58,7 @@
X(NONAUTH, 1 << 29)
/**< Non-authoritative in-bailiwick records are enough.
* TODO: utilize this also outside cache. */
\
X(FORWARD, 1 << 30)
/**< Forward all queries to upstream; validate answers */
\
/* 1 << 31 Used by
../modules/dns64/dns64.lua */
X(DNS64_MARK, 1u << 31)
/**< Internal to
../modules/dns64/dns64.lua */
/** Query flags */
enum
kr_query_flag
{
...
...
modules/dns64/dns64.lua
View file @
e67d5eca
...
...
@@ -2,7 +2,6 @@
local
ffi
=
require
(
'ffi'
)
local
bit
=
require
(
'bit'
)
local
mod
=
{}
local
MARK_DNS64
=
bit
.
lshift
(
1
,
31
)
local
addr_buf
=
ffi
.
new
(
'char[16]'
)
-- Config
function
mod
.
config
(
confstr
)
...
...
@@ -23,7 +22,7 @@ mod.layer = {
end
-- Synthetic AAAA from marked A responses
local
answer
=
pkt
:
section
(
kres
.
section
.
ANSWER
)
if
bit
.
band
(
qry
.
flags
,
MARK_DNS64
)
~=
0
then
-- Marked request
if
bit
.
band
(
qry
.
flags
,
kres
.
query
.
DNS64_MARK
)
~=
0
then
-- Marked request
local
section
=
ffi
.
C
.
knot_pkt_section
(
pkt
,
kres
.
section
.
ANSWER
)
for
i
=
1
,
section
.
count
do
local
orig
=
ffi
.
C
.
knot_pkt_rr
(
section
,
i
-
1
)
...
...
@@ -55,7 +54,7 @@ mod.layer = {
if
pkt
:
qtype
()
==
kres
.
type
.
AAAA
and
is_nodata
and
pkt
:
qname
()
==
qry
:
name
()
and
qry
:
final
()
then
local
extraFlags
=
bit
.
bor
(
bit
.
band
(
qry
.
flags
,
kres
.
query
.
DNSSEC_WANT
),
bit
.
bor
(
MARK_DNS64
,
kres
.
query
.
AWAIT_CUT
)
bit
.
bor
(
kres
.
query
.
DNS64_MARK
,
kres
.
query
.
AWAIT_CUT
)
)
local
next
=
req
:
push
(
pkt
:
qname
(),
kres
.
type
.
A
,
kres
.
class
.
IN
,
extraFlags
,
qry
)
end
...
...
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