Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
Dnsmasq
Commits
bd7bfa21
Commit
bd7bfa21
authored
Jun 01, 2015
by
swigger
Committed by
Simon Kelley
Jun 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly sanitise DNS header bits in answer when recreating query for retry.
parent
403de059
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/dns-protocol.h
src/dns-protocol.h
+7
-7
src/forward.c
src/forward.c
+2
-1
No files found.
src/dns-protocol.h
View file @
bd7bfa21
...
@@ -84,15 +84,15 @@ struct dns_header {
...
@@ -84,15 +84,15 @@ struct dns_header {
u16
qdcount
,
ancount
,
nscount
,
arcount
;
u16
qdcount
,
ancount
,
nscount
,
arcount
;
};
};
#define HB3_QR 0x80
#define HB3_QR 0x80
/* Query */
#define HB3_OPCODE 0x78
#define HB3_OPCODE 0x78
#define HB3_AA 0x04
#define HB3_AA 0x04
/* Authoritative Answer */
#define HB3_TC 0x02
#define HB3_TC 0x02
/* TrunCated */
#define HB3_RD 0x01
#define HB3_RD 0x01
/* Recursion Desired */
#define HB4_RA 0x80
#define HB4_RA 0x80
/* Recursion Available */
#define HB4_AD 0x20
#define HB4_AD 0x20
/* Authenticated Data */
#define HB4_CD 0x10
#define HB4_CD 0x10
/* Checking Disabled */
#define HB4_RCODE 0x0f
#define HB4_RCODE 0x0f
#define OPCODE(x) (((x)->hb3 & HB3_OPCODE) >> 3)
#define OPCODE(x) (((x)->hb3 & HB3_OPCODE) >> 3)
...
...
src/forward.c
View file @
bd7bfa21
...
@@ -769,7 +769,8 @@ void reply_query(int fd, int family, time_t now)
...
@@ -769,7 +769,8 @@ void reply_query(int fd, int family, time_t now)
header
->
arcount
=
htons
(
0
);
header
->
arcount
=
htons
(
0
);
if
((
nn
=
resize_packet
(
header
,
(
size_t
)
n
,
pheader
,
plen
)))
if
((
nn
=
resize_packet
(
header
,
(
size_t
)
n
,
pheader
,
plen
)))
{
{
header
->
hb3
&=
~
(
HB3_QR
|
HB3_TC
);
header
->
hb3
&=
~
(
HB3_QR
|
HB3_AA
|
HB3_TC
);
header
->
hb4
&=
~
(
HB4_RA
|
HB4_RCODE
);
forward_query
(
-
1
,
NULL
,
NULL
,
0
,
header
,
nn
,
now
,
forward
,
0
,
0
);
forward_query
(
-
1
,
NULL
,
NULL
,
0
,
header
,
nn
,
now
,
forward
,
0
,
0
);
return
;
return
;
}
}
...
...
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