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
17
Merge Requests
17
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
2c9bf8b6
Commit
2c9bf8b6
authored
May 04, 2018
by
Daniel Salzman
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libknot/pkt: return KNOT_ETRAIL instead of KNOT_EMAILF if trailing data
parent
e6e62084
Pipeline
#35975
passed with stages
in 6 minutes and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
2 deletions
+8
-2
src/libknot/errcode.h
src/libknot/errcode.h
+2
-0
src/libknot/error.c
src/libknot/error.c
+2
-0
src/libknot/packet/pkt.c
src/libknot/packet/pkt.c
+1
-1
src/libknot/packet/pkt.h
src/libknot/packet/pkt.h
+3
-1
No files found.
src/libknot/errcode.h
View file @
2c9bf8b6
...
...
@@ -156,6 +156,8 @@ enum knot_error {
KNOT_NO_PUBLIC_KEY
,
KNOT_NO_PRIVATE_KEY
,
KNOT_ETRAIL
,
KNOT_ERROR_MAX
=
-
501
};
...
...
src/libknot/error.c
View file @
2c9bf8b6
...
...
@@ -156,6 +156,8 @@ static const struct error errors[] = {
{
KNOT_NO_PUBLIC_KEY
,
"no public key"
},
{
KNOT_NO_PRIVATE_KEY
,
"no private key"
},
{
KNOT_ETRAIL
,
"trailing data"
},
{
KNOT_ERROR
,
NULL
}
/* Terminator */
};
...
...
src/libknot/packet/pkt.c
View file @
2c9bf8b6
...
...
@@ -852,7 +852,7 @@ int knot_pkt_parse_payload(knot_pkt_t *pkt, unsigned flags)
/* Check for trailing garbage. */
if
(
pkt
->
parsed
<
pkt
->
size
)
{
return
KNOT_E
MALF
;
return
KNOT_E
TRAIL
;
}
return
KNOT_EOK
;
...
...
src/libknot/packet/pkt.h
View file @
2c9bf8b6
...
...
@@ -245,7 +245,9 @@ uint16_t knot_pkt_rr_offset(const knot_pktsection_t *section, uint16_t i);
*
* \param pkt Given packet.
* \param flags Parsing flags (allowed KNOT_PF_KEEPWIRE)
* \return KNOT_EOK, KNOT_EMALF and other errors
* \retval KNOT_EOK if success.
* \retval KNOT_ETRAIL if success but with some trailing data.
* \retval KNOT_EMALF and other errors.
*/
int
knot_pkt_parse
(
knot_pkt_t
*
pkt
,
unsigned
flags
);
...
...
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