Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
69
Issues
69
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
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
ISC Open Source Projects
dhcp
Commits
840d2b47
Commit
840d2b47
authored
May 15, 2013
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Silence benign static analysis warnings.
[ISC-Bugs #33428]
parent
86910c33
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
423 additions
and
320 deletions
+423
-320
RELNOTES
RELNOTES
+3
-0
client/clparse.c
client/clparse.c
+33
-34
client/dhclient.c
client/dhclient.c
+8
-8
common/alloc.c
common/alloc.c
+1
-2
common/conflex.c
common/conflex.c
+1
-2
common/execute.c
common/execute.c
+26
-18
common/icmp.c
common/icmp.c
+3
-5
common/inet.c
common/inet.c
+1
-2
common/parse.c
common/parse.c
+123
-128
common/print.c
common/print.c
+3
-3
common/resolv.c
common/resolv.c
+4
-4
common/socket.c
common/socket.c
+2
-1
common/tree.c
common/tree.c
+1
-2
configure
configure
+79
-0
configure.ac
configure.ac
+2
-0
dhcpctl/omshell.c
dhcpctl/omshell.c
+13
-5
dst/dst_api.c
dst/dst_api.c
+2
-3
dst/prandom.c
dst/prandom.c
+2
-4
includes/config.h.in
includes/config.h.in
+3
-0
includes/dhcpd.h
includes/dhcpd.h
+19
-1
omapip/connection.c
omapip/connection.c
+2
-2
relay/dhcrelay.c
relay/dhcrelay.c
+8
-8
server/confpars.c
server/confpars.c
+73
-73
server/dhcpd.c
server/dhcpd.c
+7
-7
server/dhcpv6.c
server/dhcpv6.c
+1
-3
server/failover.c
server/failover.c
+3
-5
No files found.
RELNOTES
View file @
840d2b47
...
...
@@ -59,6 +59,9 @@ work on other platforms. Please report any problems and suggested fixes to
some
options
in
the
dhcp
universe
instead
of
all
universes
.
[
ISC
-
Bugs
#
32309
]
-
Silence
benign
static
analysis
warnings
.
[
ISC
-
Bugs
#
33428
]
-
Add
check
for
64
-
bit
package
for
atf
.
[
ISC
-
BUGS
#
32206
]
...
...
client/clparse.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
Parser for dhclient config and lease files... */
/*
* Copyright (c) 2004-201
2
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-201
3
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
...
...
@@ -241,7 +241,7 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
break
;
parse_client_statement
(
cfile
,
ip
,
client
);
}
while
(
1
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
status
=
(
cfile
->
warnings_occurred
?
ISC_R_BADPARSE
:
ISC_R_SUCCESS
);
...
...
@@ -341,7 +341,7 @@ void parse_client_statement (cfile, ip, config)
switch
(
peek_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
))
{
case
INCLUDE
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
token
!=
STRING
)
{
parse_warn
(
cfile
,
"filename string expected."
);
...
...
@@ -355,7 +355,7 @@ void parse_client_statement (cfile, ip, config)
return
;
case
KEY
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
ip
)
{
/* This may seem arbitrary, but there's a reason for
doing it: the authentication key database is not
...
...
@@ -378,7 +378,7 @@ void parse_client_statement (cfile, ip, config)
case
TOKEN_ALSO
:
/* consume ALSO */
next
_token
(
&
val
,
NULL
,
cfile
);
skip
_token
(
&
val
,
NULL
,
cfile
);
/* consume type of ALSO list. */
token
=
next_token
(
&
val
,
NULL
,
cfile
);
...
...
@@ -446,7 +446,7 @@ void parse_client_statement (cfile, ip, config)
/* REQUIRE can either start a policy statement or a
comma-separated list of names of required options. */
case
REQUIRE
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
peek_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
token
==
AUTHENTICATION
)
{
policy
=
P_REQUIRE
;
...
...
@@ -456,22 +456,22 @@ void parse_client_statement (cfile, ip, config)
return
;
case
IGNORE
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
policy
=
P_IGNORE
;
goto
do_policy
;
case
ACCEPT
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
policy
=
P_ACCEPT
;
goto
do_policy
;
case
PREFER
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
policy
=
P_PREFER
;
goto
do_policy
;
case
DONT
:
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
policy
=
P_DONT
;
goto
do_policy
;
...
...
@@ -504,8 +504,7 @@ void parse_client_statement (cfile, ip, config)
break
;
case
OPTION
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
peek_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
token
==
SPACE
)
{
if
(
ip
)
{
...
...
@@ -556,12 +555,12 @@ void parse_client_statement (cfile, ip, config)
return
;
case
MEDIA
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_string_list
(
cfile
,
&
config
->
media
,
1
);
return
;
case
HARDWARE
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
ip
)
{
parse_hardware_param
(
cfile
,
&
ip
->
hw_address
);
}
else
{
...
...
@@ -572,29 +571,29 @@ void parse_client_statement (cfile, ip, config)
return
;
case
REQUEST
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
config
->
requested_options
==
default_requested_options
)
config
->
requested_options
=
NULL
;
parse_option_list
(
cfile
,
&
config
->
requested_options
);
return
;
case
TIMEOUT
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
timeout
);
return
;
case
RETRY
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
retry_interval
);
return
;
case
SELECT_TIMEOUT
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
select_interval
);
return
;
case
OMAPI
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
token
!=
PORT
)
{
parse_warn
(
cfile
,
...
...
@@ -620,7 +619,7 @@ void parse_client_statement (cfile, ip, config)
return
;
case
DO_FORWARD_UPDATE
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
!
strcasecmp
(
val
,
"on"
)
||
!
strcasecmp
(
val
,
"true"
))
...
...
@@ -637,32 +636,32 @@ void parse_client_statement (cfile, ip, config)
return
;
case
REBOOT
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
reboot_timeout
);
return
;
case
BACKOFF_CUTOFF
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
backoff_cutoff
);
return
;
case
INITIAL_INTERVAL
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
initial_interval
);
return
;
case
INITIAL_DELAY
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_lease_time
(
cfile
,
&
config
->
initial_delay
);
return
;
case
SCRIPT
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_string
(
cfile
,
&
config
->
script_name
,
(
unsigned
*
)
0
);
return
;
case
VENDOR
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
token
!=
OPTION
)
{
parse_warn
(
cfile
,
"expecting 'vendor option space'"
);
...
...
@@ -697,14 +696,14 @@ void parse_client_statement (cfile, ip, config)
return
;
case
INTERFACE
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
if
(
ip
)
parse_warn
(
cfile
,
"nested interface declaration."
);
parse_interface_declaration
(
cfile
,
config
,
(
char
*
)
0
);
return
;
case
PSEUDO
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
name
=
dmalloc
(
strlen
(
val
)
+
1
,
MDL
);
if
(
!
name
)
...
...
@@ -714,17 +713,17 @@ void parse_client_statement (cfile, ip, config)
return
;
case
LEASE
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_client_lease_statement
(
cfile
,
1
);
return
;
case
ALIAS
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_client_lease_statement
(
cfile
,
2
);
return
;
case
REJECT
:
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
parse_reject_statement
(
cfile
,
config
);
return
;
...
...
@@ -795,7 +794,7 @@ parse_option_list(struct parse *cfile, struct option ***list)
}
if
(
!
is_identifier
(
token
))
{
parse_warn
(
cfile
,
"%s: expected option name."
,
val
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_to_semi
(
cfile
);
return
0
;
}
...
...
@@ -911,7 +910,7 @@ void parse_interface_declaration (cfile, outer_config, name)
break
;
parse_client_statement
(
cfile
,
ip
,
client
->
config
);
}
while
(
1
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
}
int
interface_or_dummy
(
struct
interface_info
**
pi
,
const
char
*
name
)
...
...
@@ -1038,7 +1037,7 @@ void parse_client_lease_statement (cfile, is_static)
break
;
parse_client_lease_declaration
(
cfile
,
lease
,
&
ip
,
&
client
);
}
while
(
1
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
/* If the lease declaration didn't include an interface
declaration that we recognized, it's of no use to us. */
...
...
client/dhclient.c
View file @
840d2b47
...
...
@@ -390,7 +390,6 @@ main(int argc, char **argv) {
long
temp
;
int
e
;
oldpid
=
0
;
if
((
pidfd
=
fopen
(
path_dhclient_pid
,
"r"
))
!=
NULL
)
{
e
=
fscanf
(
pidfd
,
"%ld
\n
"
,
&
temp
);
oldpid
=
(
pid_t
)
temp
;
...
...
@@ -3459,17 +3458,17 @@ void go_daemon ()
else
if
(
pid
)
exit
(
0
);
/* Become session leader and get pid... */
pid
=
setsid
();
(
void
)
setsid
();
/* Close standard I/O descriptors. */
close
(
0
);
close
(
1
);
close
(
2
);
(
void
)
close
(
0
);
(
void
)
close
(
1
);
(
void
)
close
(
2
);
/* Reopen them on /dev/null. */
open
(
"/dev/null"
,
O_RDWR
);
open
(
"/dev/null"
,
O_RDWR
);
open
(
"/dev/null"
,
O_RDWR
);
(
void
)
open
(
"/dev/null"
,
O_RDWR
);
(
void
)
open
(
"/dev/null"
,
O_RDWR
);
(
void
)
open
(
"/dev/null"
,
O_RDWR
);
write_client_pid_file
();
...
...
@@ -3892,6 +3891,7 @@ isc_result_t client_dns_update (struct client_state *client, int addp,
memset
(
&
ddns_dhcid
,
0
,
sizeof
ddns_dhcid
);
result
=
0
;
POST
(
result
);
memset
(
&
client_identifier
,
0
,
sizeof
(
client_identifier
));
if
(
client
->
active_lease
!=
NULL
)
{
if
(((
oc
=
...
...
common/alloc.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
Memory allocation... */
/*
* Copyright (c) 2009,201
2
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009,201
3
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
...
...
@@ -143,7 +143,6 @@ int option_chain_head_dereference (ptr, file, line)
option_cache_dereference
((
struct
option_cache
**
)
(
&
car
->
car
),
MDL
);
dfree
(
car
,
MDL
);
car
=
cdr
;
}
dfree
(
option_chain_head
,
file
,
line
);
...
...
common/conflex.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
Lexical scanner for dhcpd config file... */
/*
* Copyright (c) 2011-201
2
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2011-201
3
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
...
...
@@ -528,7 +528,6 @@ static enum dhcp_token read_string (cfile)
goto
again
;
default:
cfile
->
tokbuf
[
i
]
=
c
;
bs
=
0
;
break
;
}
bs
=
0
;
...
...
common/execute.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
Support for executable statements. */
/*
* Copyright (c) 2009,201
2
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009,201
3
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998-2003 by Internet Software Consortium
*
...
...
@@ -181,6 +181,8 @@ int execute_statements (result, packet, lease, client_state,
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: evaluate: %s"
,
(
status
?
"succeeded"
:
"failed"
));
#else
POST
(
status
);
#endif
break
;
...
...
@@ -272,6 +274,8 @@ int execute_statements (result, packet, lease, client_state,
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: return: %s"
,
(
status
?
"succeeded"
:
"failed"
));
#else
POST
(
status
);
#endif
break
;
...
...
@@ -331,20 +335,20 @@ int execute_statements (result, packet, lease, client_state,
if
(
!
scope
)
{
log_error
(
"set %s: no scope"
,
r
->
data
.
set
.
name
);
status
=
0
;
break
;
}
if
(
!*
scope
)
{
if
(
!
binding_scope_allocate
(
scope
,
MDL
))
{
log_error
(
"set %s: can't allocate scope"
,
r
->
data
.
set
.
name
);
status
=
0
;
break
;
}
}
binding
=
find_binding
(
*
scope
,
r
->
data
.
set
.
name
);
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: set %s"
,
r
->
data
.
set
.
name
);
#else
POST
(
status
);
#endif
if
(
binding
==
NULL
)
{
binding
=
dmalloc
(
sizeof
(
*
binding
),
MDL
);
...
...
@@ -395,14 +399,14 @@ int execute_statements (result, packet, lease, client_state,
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: set %s%s"
,
r
->
data
.
set
.
name
,
(
binding
&&
status
?
""
:
" (failed)"
));
#else
POST
(
status
);
#endif
break
;
case
unset_statement
:
if
(
!
scope
||
!*
scope
)
{
status
=
0
;
if
(
!
scope
||
!*
scope
)
break
;
}
binding
=
find_binding
(
*
scope
,
r
->
data
.
unset
);
if
(
binding
)
{
if
(
binding
->
value
)
...
...
@@ -414,6 +418,8 @@ int execute_statements (result, packet, lease, client_state,
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: unset %s: %s"
,
r
->
data
.
unset
,
(
status
?
"found"
:
"not found"
));
#else
POST
(
status
);
#endif
break
;
...
...
@@ -463,6 +469,8 @@ int execute_statements (result, packet, lease, client_state,
#if defined (DEBUG_EXPRESSIONS)
log_debug
(
"exec: let %s%s"
,
e
->
data
.
let
.
name
,
(
binding
&&
status
?
""
:
"failed"
));
#else
POST
(
status
);
#endif
if
(
!
e
->
data
.
let
.
statements
)
{
}
else
if
(
e
->
data
.
let
.
statements
->
op
==
...
...
@@ -758,11 +766,11 @@ void write_statements (file, statements, indent)
}
if
(
r
->
data
.
on
.
evtypes
&
ON_COMMIT
)
{
fprintf
(
file
,
"%scommit"
,
s
);
s
=
"
or
"
;
s
=
"
or
"
;
}
if
(
r
->
data
.
on
.
evtypes
&
ON_RELEASE
)
{
fprintf
(
file
,
"%srelease"
,
s
);
s
=
"or"
;
/* s = " or "; */
}
if
(
r
->
data
.
on
.
statements
)
{
fprintf
(
file
,
" {"
);
...
...
@@ -842,7 +850,7 @@ void write_statements (file, statements, indent)
case
eval_statement
:
indent_spaces
(
file
,
indent
);
fprintf
(
file
,
"eval "
);
col
=
write_expression
(
file
,
r
->
data
.
eval
,
(
void
)
write_expression
(
file
,
r
->
data
.
eval
,
indent
+
5
,
indent
+
5
,
1
);
fprintf
(
file
,
";"
);
break
;
...
...
@@ -916,11 +924,11 @@ void write_statements (file, statements, indent)
fprintf
(
file
,
"set "
);
col
=
token_print_indent
(
file
,
indent
+
4
,
indent
+
4
,
""
,
""
,
r
->
data
.
set
.
name
);
col
=
token_print_indent
(
file
,
col
,
indent
+
4
,
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
" "
,
" "
,
"="
);
col
=
write_expression
(
file
,
r
->
data
.
set
.
expr
,
indent
+
3
,
indent
+
3
,
0
);
col
=
token_print_indent
(
file
,
col
,
indent
+
4
,
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
" "
,
""
,
";"
);
break
;
...
...
@@ -929,7 +937,7 @@ void write_statements (file, statements, indent)
fprintf
(
file
,
"unset "
);
col
=
token_print_indent
(
file
,
indent
+
6
,
indent
+
6
,
""
,
""
,
r
->
data
.
set
.
name
);
col
=
token_print_indent
(
file
,
col
,
indent
+
6
,
(
void
)
token_print_indent
(
file
,
col
,
indent
+
6
,
" "
,
""
,
";"
);
break
;
...
...
@@ -940,29 +948,29 @@ void write_statements (file, statements, indent)
""
,
""
,
"("
);
switch
(
r
->
data
.
log
.
priority
)
{
case
log_priority_fatal
:
col
=
token_print_indent
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
" "
,
"fatal,"
);
break
;
case
log_priority_error
:
col
=
token_print_indent
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
" "
,
"error,"
);
break
;
case
log_priority_debug
:
col
=
token_print_indent
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
" "
,
"debug,"
);
break
;
case
log_priority_info
:
col
=
token_print_indent
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
" "
,
"info,"
);
break
;
}
col
=
write_expression
(
file
,
r
->
data
.
log
.
expr
,
indent
+
4
,
indent
+
4
,
0
);
col
=
token_print_indent
(
file
,
col
,
indent
+
4
,
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
""
,
");"
);
break
;
...
...
@@ -979,7 +987,7 @@ void write_statements (file, statements, indent)
col
=
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
" "
,
","
);
col
=
write_expression
(
file
,
expr
->
data
.
arg
.
val
,
col
,
indent
+
4
,
0
);
}
col
=
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
""
,
");"
);
(
void
)
token_print_indent
(
file
,
col
,
indent
+
4
,
""
,
""
,
");"
);
#else
/* !ENABLE_EXECUTE */
log_fatal
(
"Impossible case at %s:%d (ENABLE_EXECUTE "
"is not defined)."
,
MDL
);
...
...
common/icmp.c
View file @
840d2b47
...
...
@@ -4,7 +4,7 @@
responses. */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2011
,2013
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
...
...
@@ -289,17 +289,15 @@ void trace_icmp_input_stop (trace_type_t *ttype) { }
void
trace_icmp_output_input
(
trace_type_t
*
ttype
,
unsigned
length
,
char
*
buf
)
{
struct
icmp
*
icmp
;
struct
iaddr
ia
;
if
(
length
!=
(
sizeof
(
*
icmp
)
+
(
sizeof
ia
)))
{
if
(
length
!=
(
sizeof
(
struct
icmp
)
+
sizeof
(
ia
)))
{
log_error
(
"trace_icmp_output_input: data size mismatch %d:%d"
,
length
,
(
int
)(
(
sizeof
(
*
icmp
))
+
(
sizeof
ia
)));
length
,
(
int
)(
sizeof
(
struct
icmp
)
+
sizeof
(
ia
)));
return
;
}
ia
.
len
=
4
;
memcpy
(
ia
.
iabuf
,
buf
,
4
);
icmp
=
(
struct
icmp
*
)(
buf
+
1
);
log_error
(
"trace_icmp_output_input: unsent ping to %s"
,
piaddr
(
ia
));
}
...
...
common/inet.c
View file @
840d2b47
...
...
@@ -4,7 +4,7 @@
way... */
/*
* Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2011
,2013
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2007-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004,2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
...
...
@@ -198,7 +198,6 @@ addr_match(addr, match)
if
(
addr
->
len
!=
match
->
addr
.
len
)
return
0
;
i
=
0
;
for
(
i
=
0
;
i
<
addr
->
len
;
i
++
)
{
if
((
addr
->
iabuf
[
i
]
&
match
->
mask
.
iabuf
[
i
])
!=
match
->
addr
.
iabuf
[
i
])
...
...
common/parse.c
View file @
840d2b47
This diff is collapsed.
Click to expand it.
common/print.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
Turn data structures into printable text. */
/*
* Copyright (c) 2009-201
2
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009-201
3
by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
...
...
@@ -1186,7 +1186,7 @@ int token_print_indent_concat (FILE *file, int col, int indent,
}
va_end
(
list
);
len
=
token_print_indent
(
file
,
col
,
indent
,
col
=
token_print_indent
(
file
,
col
,
indent
,
prefix
,
suffix
,
t
);
dfree
(
t
,
MDL
);
return
col
;
...
...
@@ -1241,7 +1241,7 @@ int token_print_indent (FILE *file, int col, int indent,
{
int
len
=
0
;
if
(
prefix
!=
NULL
)
len
=
strlen
(
prefix
);
len
+
=
strlen
(
prefix
);
if
(
buf
!=
NULL
)
len
+=
strlen
(
buf
);
...
...
common/resolv.c
View file @
840d2b47
...
...
@@ -3,7 +3,8 @@
Parser for /etc/resolv.conf file. */
/*
* Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
...
...
@@ -89,7 +90,6 @@ void read_resolv_conf (parse_time)
(
struct
domain_search_list
*
)
0
;
*
dp
=
nd
;
nd
->
domain
=
dn
;
dn
=
(
char
*
)
0
;
}
nd
->
rcdate
=
parse_time
;
token
=
peek_token
(
&
val
,
...
...
@@ -100,7 +100,7 @@ void read_resolv_conf (parse_time)
"junk after domain declaration"
);
skip_to_semi
(
cfile
);
}
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
}
else
if
(
token
==
NAMESERVER
)
{
struct
name_server
*
ns
,
**
sp
;
struct
iaddr
iaddr
;
...
...
@@ -136,7 +136,7 @@ void read_resolv_conf (parse_time)
}
else
skip_to_semi
(
cfile
);
/* Ignore what we don't grok. */
}
while
(
1
);
token
=
next_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
skip_token
(
&
val
,
(
unsigned
*
)
0
,
cfile
);
/* Lose servers that are no longer in /etc/resolv.conf. */
sl
=
(
struct
name_server
*
)
0
;
...
...
common/socket.c
View file @
840d2b47
...
...
@@ -3,7 +3,7 @@
BSD socket interface code... */
/*
* Copyright (c) 2004-201
2
by Internet Systems Consortium, Inc. ("ISC")