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
c4a7f90e
Commit
c4a7f90e
authored
Jul 12, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Config parsing error-handling update.
parent
9609baee
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
292 additions
and
349 deletions
+292
-349
CHANGELOG
CHANGELOG
+3
-0
src/dhcp-common.c
src/dhcp-common.c
+0
-34
src/dhcp.c
src/dhcp.c
+1
-3
src/dnsmasq.c
src/dnsmasq.c
+0
-1
src/dnsmasq.h
src/dnsmasq.h
+0
-1
src/option.c
src/option.c
+288
-310
No files found.
CHANGELOG
View file @
c4a7f90e
...
...
@@ -21,6 +21,9 @@ version 2.63
been used, had very strange semantics, and have been
superceded by other mechanisms.
Fixed bug logging filenames when duplicate dhcp-host
addresses are found. Thanks to John Hanks for the patch.
version 2.62
Update German translation. Thanks to Conrad Kostecki.
...
...
src/dhcp-common.c
View file @
c4a7f90e
...
...
@@ -246,40 +246,6 @@ int match_bytes(struct dhcp_opt *o, unsigned char *p, int len)
return
0
;
}
void
check_dhcp_hosts
(
int
fatal
)
{
/* If the same IP appears in more than one host config, then DISCOVER
for one of the hosts will get the address, but REQUEST will be NAKed,
since the address is reserved by the other one -> protocol loop.
Also check that FQDNs match the domain we are using. */
struct
dhcp_config
*
configs
,
*
cp
;
for
(
configs
=
daemon
->
dhcp_conf
;
configs
;
configs
=
configs
->
next
)
{
char
*
domain
;
if
((
configs
->
flags
&
DHOPT_BANK
)
||
fatal
)
{
for
(
cp
=
configs
->
next
;
cp
;
cp
=
cp
->
next
)
if
((
configs
->
flags
&
cp
->
flags
&
CONFIG_ADDR
)
&&
configs
->
addr
.
s_addr
==
cp
->
addr
.
s_addr
)
{
if
(
fatal
)
die
(
_
(
"duplicate IP address %s in dhcp-config directive."
),
inet_ntoa
(
cp
->
addr
),
EC_BADCONF
);
else
my_syslog
(
MS_DHCP
|
LOG_ERR
,
_
(
"duplicate IP address %s in %s."
),
inet_ntoa
(
cp
->
addr
),
daemon
->
dhcp_hosts_file
);
configs
->
flags
&=
~
CONFIG_ADDR
;
}
/* split off domain part */
if
((
configs
->
flags
&
CONFIG_NAME
)
&&
(
domain
=
strip_hostname
(
configs
->
hostname
)))
configs
->
domain
=
domain
;
}
}
}
void
dhcp_update_configs
(
struct
dhcp_config
*
configs
)
{
/* Some people like to keep all static IP addresses in /etc/hosts.
...
...
src/dhcp.c
View file @
c4a7f90e
...
...
@@ -116,9 +116,7 @@ void dhcp_init(void)
/* Make BPF raw send socket */
init_bpf
();
#endif
check_dhcp_hosts
(
1
);
#endif
}
void
dhcp_packet
(
time_t
now
,
int
pxe_fd
)
...
...
src/dnsmasq.c
View file @
c4a7f90e
...
...
@@ -1243,7 +1243,6 @@ void clear_cache_and_reload(time_t now)
dhcp_read_ethers
();
reread_dhcp
();
dhcp_update_configs
(
daemon
->
dhcp_conf
);
check_dhcp_hosts
(
0
);
lease_update_from_configs
();
lease_update_file
(
now
);
lease_update_dns
(
1
);
...
...
src/dnsmasq.h
View file @
c4a7f90e
...
...
@@ -1123,7 +1123,6 @@ char *strip_hostname(char *hostname);
void
log_tags
(
struct
dhcp_netid
*
netid
,
u32
xid
);
int
match_bytes
(
struct
dhcp_opt
*
o
,
unsigned
char
*
p
,
int
len
);
void
dhcp_update_configs
(
struct
dhcp_config
*
configs
);
void
check_dhcp_hosts
(
int
fatal
);
void
display_opts
(
void
);
u16
lookup_dhcp_opt
(
int
prot
,
char
*
name
);
u16
lookup_dhcp_len
(
int
prot
,
u16
val
);
...
...
src/option.c
View file @
c4a7f90e
This diff is collapsed.
Click to expand it.
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