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
771287be
Commit
771287be
authored
Dec 30, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wildcards in dhcp-range constructors
parent
dc9476b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
src/dhcp-common.c
src/dhcp-common.c
+8
-3
src/dhcp6.c
src/dhcp6.c
+3
-2
src/dnsmasq.h
src/dnsmasq.h
+1
-1
src/option.c
src/option.c
+5
-0
No files found.
src/dhcp-common.c
View file @
771287be
...
@@ -712,14 +712,19 @@ void log_context(int family, struct dhcp_context *context)
...
@@ -712,14 +712,19 @@ void log_context(int family, struct dhcp_context *context)
#ifdef HAVE_DHCP6
#ifdef HAVE_DHCP6
if
(
context
->
flags
&
CONTEXT_CONSTRUCTED
)
if
(
context
->
flags
&
CONTEXT_CONSTRUCTED
)
{
{
n
=
p
;
char
ifrn_name
[
IFNAMSIZ
];
p
+=
sprintf
(
p
,
", constructed for %s"
,
context
->
template_interface
);
if
(
indextoname
(
daemon
->
doing_dhcp6
?
daemon
->
dhcp6fd
:
daemon
->
icmp6fd
,
context
->
if_index
,
ifrn_name
))
{
n
=
p
;
p
+=
sprintf
(
p
,
", constructed for %s"
,
ifrn_name
);
}
}
}
if
(
context
->
flags
&
CONTEXT_TEMPLATE
)
if
(
context
->
flags
&
CONTEXT_TEMPLATE
)
{
{
n
=
p
;
n
=
p
;
p
+=
sprintf
(
p
,
", template for %s"
,
context
->
template_interface
);
p
+=
sprintf
(
p
,
", template for %s%s"
,
context
->
template_interface
,
(
context
->
flags
&
CONTEXT_WILDCARD
)
?
"*"
:
""
);
}
}
#endif
#endif
...
...
src/dhcp6.c
View file @
771287be
...
@@ -531,8 +531,9 @@ static int construct_worker(struct in6_addr *local, int prefix,
...
@@ -531,8 +531,9 @@ static int construct_worker(struct in6_addr *local, int prefix,
}
}
}
}
else
if
(
strcmp
(
ifrn_name
,
template
->
template_interface
)
==
0
&&
else
if
(
addr6part
(
local
)
==
addr6part
(
&
template
->
start6
)
&&
addr6part
(
local
)
==
addr6part
(
&
template
->
start6
))
strncmp
(
template
->
template_interface
,
ifrn_name
,
strlen
(
template
->
template_interface
))
==
0
&&
(
strlen
(
template
->
template_interface
)
==
strlen
(
ifrn_name
)
||
(
template
->
flags
&
CONTEXT_WILDCARD
)))
{
{
start6
=
*
local
;
start6
=
*
local
;
setaddr6part
(
&
start6
,
addr6part
(
&
template
->
start6
));
setaddr6part
(
&
start6
,
addr6part
(
&
template
->
start6
));
...
...
src/dnsmasq.h
View file @
771287be
...
@@ -706,7 +706,7 @@ struct dhcp_context {
...
@@ -706,7 +706,7 @@ struct dhcp_context {
#define CONTEXT_CONSTRUCTED 2048
#define CONTEXT_CONSTRUCTED 2048
#define CONTEXT_GC 4096
#define CONTEXT_GC 4096
#define CONTEXT_RA 8192
#define CONTEXT_RA 8192
#define CONTEXT_WILDCARD 16384
struct
ping_result
{
struct
ping_result
{
struct
in_addr
addr
;
struct
in_addr
addr
;
...
...
src/option.c
View file @
771287be
...
@@ -2291,6 +2291,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2291,6 +2291,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
new
->
flags
|=
CONTEXT_DHCP
;
new
->
flags
|=
CONTEXT_DHCP
;
else
if
(
strstr
(
a
[
leasepos
],
"constructor:"
)
==
a
[
leasepos
])
else
if
(
strstr
(
a
[
leasepos
],
"constructor:"
)
==
a
[
leasepos
])
{
{
if
(
a
[
leasepos
][
strlen
(
a
[
leasepos
])
-
1
]
==
'*'
)
{
a
[
leasepos
][
strlen
(
a
[
leasepos
])
-
1
]
=
0
;
new
->
flags
|=
CONTEXT_WILDCARD
;
}
new
->
template_interface
=
opt_string_alloc
(
a
[
leasepos
]
+
12
);
new
->
template_interface
=
opt_string_alloc
(
a
[
leasepos
]
+
12
);
new
->
flags
|=
CONTEXT_TEMPLATE
;
new
->
flags
|=
CONTEXT_TEMPLATE
;
}
}
...
...
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