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
a93bd4b0
Commit
a93bd4b0
authored
Mar 01, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken DNSMASQ_USER<x> envvars in script with more than one class.
parent
407a1f3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
src/lease.c
src/lease.c
+12
-8
src/rfc2131.c
src/rfc2131.c
+1
-1
No files found.
src/lease.c
View file @
a93bd4b0
...
@@ -1110,18 +1110,22 @@ int do_script_run(time_t now)
...
@@ -1110,18 +1110,22 @@ int do_script_run(time_t now)
}
}
#ifdef HAVE_SCRIPT
#ifdef HAVE_SCRIPT
/* delim == -1 -> delim = 0, but embeded 0s, creating extra records, are OK. */
void
lease_add_extradata
(
struct
dhcp_lease
*
lease
,
unsigned
char
*
data
,
unsigned
int
len
,
int
delim
)
void
lease_add_extradata
(
struct
dhcp_lease
*
lease
,
unsigned
char
*
data
,
unsigned
int
len
,
int
delim
)
{
{
unsigned
int
i
;
unsigned
int
i
;
/* check for embeded NULLs */
if
(
delim
==
-
1
)
for
(
i
=
0
;
i
<
len
;
i
++
)
delim
=
0
;
if
(
data
[
i
]
==
0
)
else
{
/* check for embeded NULLs */
len
=
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
break
;
if
(
data
[
i
]
==
0
)
}
{
len
=
i
;
break
;
}
if
((
lease
->
extradata_size
-
lease
->
extradata_len
)
<
(
len
+
1
))
if
((
lease
->
extradata_size
-
lease
->
extradata_len
)
<
(
len
+
1
))
{
{
size_t
newsz
=
lease
->
extradata_len
+
len
+
100
;
size_t
newsz
=
lease
->
extradata_len
+
len
+
100
;
...
...
src/rfc2131.c
View file @
a93bd4b0
...
@@ -1308,7 +1308,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
...
@@ -1308,7 +1308,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
/* If the user-class option started as counted strings, the first byte will be zero. */
/* If the user-class option started as counted strings, the first byte will be zero. */
if
(
len
!=
0
&&
ucp
[
0
]
==
0
)
if
(
len
!=
0
&&
ucp
[
0
]
==
0
)
ucp
++
,
len
--
;
ucp
++
,
len
--
;
lease_add_extradata
(
lease
,
ucp
,
len
,
0
);
lease_add_extradata
(
lease
,
ucp
,
len
,
-
1
);
}
}
}
}
#endif
#endif
...
...
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