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
3f3adae6
Commit
3f3adae6
authored
Jul 25, 2013
by
Roy Marples
Committed by
Simon Kelley
Jul 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DHCP FQDN option tweaks.
parent
1ecbaaa3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
CHANGELOG
CHANGELOG
+5
-0
src/rfc2131.c
src/rfc2131.c
+9
-5
src/rfc3315.c
src/rfc3315.c
+6
-4
No files found.
CHANGELOG
View file @
3f3adae6
...
@@ -63,6 +63,11 @@ version 2.67
...
@@ -63,6 +63,11 @@ version 2.67
Allow hostnames to start with a number, as allowed in
Allow hostnames to start with a number, as allowed in
RFC-1123. Thanks to Kyle Mestery for the patch.
RFC-1123. Thanks to Kyle Mestery for the patch.
Fixes to DHCP FQDN option handling: don't terminate FQDN
if domain not known and allow a FQDN option with blank
name to request that a FQDN option is returned in the
reply. Thanks to Roy Marples for the patch.
version 2.66
version 2.66
Add the ability to act as an authoritative DNS
Add the ability to act as an authoritative DNS
...
...
src/rfc2131.c
View file @
3f3adae6
...
@@ -615,7 +615,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
...
@@ -615,7 +615,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
return
message
?
0
:
dhcp_packet_size
(
mess
,
agent_id
,
real_end
);
return
message
?
0
:
dhcp_packet_size
(
mess
,
agent_id
,
real_end
);
}
}
if
((
opt
=
option_find
(
mess
,
sz
,
OPTION_CLIENT_FQDN
,
4
)))
if
((
opt
=
option_find
(
mess
,
sz
,
OPTION_CLIENT_FQDN
,
3
)))
{
{
/* http://tools.ietf.org/wg/dhc/draft-ietf-dhc-fqdn-option/draft-ietf-dhc-fqdn-option-10.txt */
/* http://tools.ietf.org/wg/dhc/draft-ietf-dhc-fqdn-option/draft-ietf-dhc-fqdn-option-10.txt */
int
len
=
option_len
(
opt
);
int
len
=
option_len
(
opt
);
...
@@ -645,7 +645,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
...
@@ -645,7 +645,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
}
}
if
(
fqdn_flags
&
0x04
)
if
(
fqdn_flags
&
0x04
)
while
(
*
op
!=
0
&&
((
op
+
(
*
op
)
+
1
)
-
pp
)
<
len
)
while
(
*
op
!=
0
&&
((
op
+
(
*
op
))
-
pp
)
<
len
)
{
{
memcpy
(
pq
,
op
+
1
,
*
op
);
memcpy
(
pq
,
op
+
1
,
*
op
);
pq
+=
*
op
;
pq
+=
*
op
;
...
@@ -2289,7 +2289,9 @@ static void do_options(struct dhcp_context *context,
...
@@ -2289,7 +2289,9 @@ static void do_options(struct dhcp_context *context,
if
(
domain
)
if
(
domain
)
len
+=
strlen
(
domain
)
+
1
;
len
+=
strlen
(
domain
)
+
1
;
else
if
(
fqdn_flags
&
0x04
)
len
--
;
if
((
p
=
free_space
(
mess
,
end
,
OPTION_CLIENT_FQDN
,
len
)))
if
((
p
=
free_space
(
mess
,
end
,
OPTION_CLIENT_FQDN
,
len
)))
{
{
*
(
p
++
)
=
fqdn_flags
&
0x0f
;
/* MBZ bits to zero */
*
(
p
++
)
=
fqdn_flags
&
0x0f
;
/* MBZ bits to zero */
...
@@ -2300,8 +2302,10 @@ static void do_options(struct dhcp_context *context,
...
@@ -2300,8 +2302,10 @@ static void do_options(struct dhcp_context *context,
{
{
p
=
do_rfc1035_name
(
p
,
hostname
);
p
=
do_rfc1035_name
(
p
,
hostname
);
if
(
domain
)
if
(
domain
)
p
=
do_rfc1035_name
(
p
,
domain
);
{
*
p
++
=
0
;
p
=
do_rfc1035_name
(
p
,
domain
);
*
p
++
=
0
;
}
}
}
else
else
{
{
...
...
src/rfc3315.c
View file @
3f3adae6
...
@@ -1299,16 +1299,18 @@ struct dhcp_netid *add_options(struct state *state, struct in6_addr *fallback, s
...
@@ -1299,16 +1299,18 @@ struct dhcp_netid *add_options(struct state *state, struct in6_addr *fallback, s
size_t
len
=
strlen
(
state
->
hostname
);
size_t
len
=
strlen
(
state
->
hostname
);
if
(
state
->
send_domain
)
if
(
state
->
send_domain
)
len
+=
strlen
(
state
->
send_domain
)
+
1
;
len
+=
strlen
(
state
->
send_domain
)
+
2
;
o
=
new_opt6
(
OPTION6_FQDN
);
o
=
new_opt6
(
OPTION6_FQDN
);
if
((
p
=
expand
(
len
+
3
)))
if
((
p
=
expand
(
len
+
2
)))
{
{
*
(
p
++
)
=
state
->
fqdn_flags
;
*
(
p
++
)
=
state
->
fqdn_flags
;
p
=
do_rfc1035_name
(
p
,
state
->
hostname
);
p
=
do_rfc1035_name
(
p
,
state
->
hostname
);
if
(
state
->
send_domain
)
if
(
state
->
send_domain
)
p
=
do_rfc1035_name
(
p
,
state
->
send_domain
);
{
*
p
=
0
;
p
=
do_rfc1035_name
(
p
,
state
->
send_domain
);
*
p
=
0
;
}
}
}
end_opt6
(
o
);
end_opt6
(
o
);
}
}
...
...
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