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 DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
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 DNS
Commits
c3c124f1
Commit
c3c124f1
authored
Jul 17, 2015
by
Daniel Salzman
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edns: remove duplicate constants and a function
parent
739daa6b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
27 deletions
+6
-27
src/knot/nameserver/process_query.c
src/knot/nameserver/process_query.c
+1
-1
src/libknot/rrtype/opt.c
src/libknot/rrtype/opt.c
+0
-7
src/libknot/rrtype/opt.h
src/libknot/rrtype/opt.h
+1
-16
tests/edns.c
tests/edns.c
+4
-3
No files found.
src/knot/nameserver/process_query.c
View file @
c3c124f1
...
...
@@ -239,7 +239,7 @@ static int answer_edns_init(const knot_pkt_t *query, knot_pkt_t *resp,
/* Append NSID if requested and available. */
val
=
conf_get
(
conf
(),
C_SRV
,
C_NSID
);
if
(
knot_edns_has_
nsid
(
query
->
opt_rr
))
{
if
(
knot_edns_has_
option
(
query
->
opt_rr
,
KNOT_EDNS_OPTION_NSID
))
{
conf_data
(
&
val
);
if
(
val
.
code
!=
KNOT_EOK
)
{
ret
=
knot_edns_add_option
(
&
qdata
->
opt_rr
,
...
...
src/libknot/rrtype/opt.c
View file @
c3c124f1
...
...
@@ -275,13 +275,6 @@ bool knot_edns_has_option(const knot_rrset_t *opt_rr, uint16_t code)
return
pos
!=
NULL
;
}
/*----------------------------------------------------------------------------*/
_public_
bool
knot_edns_has_nsid
(
const
knot_rrset_t
*
opt_rr
)
{
return
knot_edns_has_option
(
opt_rr
,
KNOT_EDNS_OPTION_NSID
);
}
/*----------------------------------------------------------------------------*/
_public_
bool
knot_edns_check_record
(
knot_rrset_t
*
opt_rr
)
...
...
src/libknot/rrtype/opt.h
View file @
c3c124f1
...
...
@@ -26,13 +26,8 @@
#pragma once
#include <stdint.h>
#include "libknot/rrset.h"
/* Forward declaration. */
struct
knot_packet
;
/*! \brief Constants related to EDNS. */
enum
knot_edns_const
{
/*! \brief Supported EDNS version. */
...
...
@@ -57,23 +52,13 @@ enum knot_edns_const {
/*! \brief NSID option code. */
KNOT_EDNS_OPTION_NSID
=
3
,
/*! \brief EDNS client subnet option code. */
KNOT_EDNS_OPTION_CLIENT_SUBNET
=
8
,
/*! \brief Extended RCODE BADVERS. */
KNOT_EDNS_RCODE_BADVERS
=
16
,
KNOT_EDNS_OPTION_CLIENT_SUBNET
=
8
};
/* Helpers for splitting extended RCODE. */
#define KNOT_EDNS_RCODE_HI(rc) ((rc >> 4) & 0x00ff)
#define KNOT_EDNS_RCODE_LO(rc) (rc & 0x000f)
/*!
* \brief EDNS DO flag.
*
* \note Use only with unsigned 2-byte variables.
* \warning Flags are represented in machine byte order.
*/
static
const
uint16_t
KNOT_EDNS_FLAG_DO
=
(
uint16_t
)
1
<<
15
;
/*----------------------------------------------------------------------------*/
/* EDNS OPT RR handling functions. */
/*----------------------------------------------------------------------------*/
...
...
tests/edns.c
View file @
c3c124f1
...
...
@@ -63,6 +63,8 @@ enum offsets {
OFFSET_OPT_DATA
=
4
};
static
const
uint16_t
DO_FLAG
=
(
uint16_t
)
1
<<
15
;
static
bool
check_ttl
(
knot_rdata_t
*
rdata
,
uint8_t
ext_rcode
,
uint8_t
ver
,
uint16_t
flags
,
char
*
msg
,
int
*
done
)
{
...
...
@@ -261,9 +263,8 @@ static bool test_setters(knot_rrset_t *opt_rr, int *done)
knot_edns_set_do
(
opt_rr
);
bool
success
=
true
;
bool
check
=
check_header
(
opt_rr
,
E_MAX_PLD2
,
E_VERSION2
,
KNOT_EDNS_FLAG_DO
,
E_RCODE2
,
"OPT RR setters"
,
done
);
bool
check
=
check_header
(
opt_rr
,
E_MAX_PLD2
,
E_VERSION2
,
DO_FLAG
,
E_RCODE2
,
"OPT RR setters"
,
done
);
success
&=
check
;
/* OPTION(RDATA)-related setters. */
...
...
Robert Edmonds
@edmonds
mentioned in issue
#523 (closed)
·
Jun 28, 2017
mentioned in issue
#523 (closed)
mentioned in issue #523
Toggle commit list
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