Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
dhcp
Commits
97050349
Commit
97050349
authored
Aug 14, 2007
by
Shane Kerr
Browse files
Fix for interface detection when no IPv4 addresses available.
See RT ticket #17086 for more.
parent
70aa0d58
Changes
2
Show whitespace changes
Inline
Side-by-side
RELNOTES
View file @
97050349
...
...
@@ -53,6 +53,9 @@ suggested fixes to <dhcp-users@isc.org>.
Changes
since
4.0.0
a2
-
Fix
for
startup
where
there
are
no
IPv4
addresses
on
an
interface
.
Thanks
to
Marcus
Goller
for
reporting
the
bug
.
-
Fixed
file
descriptor
leak
on
listen
failure
.
Thanks
to
Tom
Clark
.
-
Bug
in
server
configuration
parser
caused
server
to
get
stuck
on
...
...
common/discover.c
View file @
97050349
...
...
@@ -233,7 +233,7 @@ begin_iface_scan(struct iface_conf_list *ifaces) {
int
lifnum
;
#endif
ifaces
->
sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
ifaces
->
sock
=
socket
(
local_family
,
SOCK_DGRAM
,
IPPROTO_UDP
);
if
(
ifaces
->
sock
<
0
)
{
log_error
(
"Error creating socket to list interfaces; %m"
);
return
0
;
...
...
@@ -1152,12 +1152,24 @@ discover_interfaces(int state) {
?
tmp
->
shared_network
->
subnets
:
(
struct
subnet
*
)
0
);
subnet
;
subnet
=
subnet
->
next_sibling
)
{
if
(
!
subnet
->
interface_address
.
len
)
{
/* Set the interface address for this subnet
to the first address we found. */
subnet
->
interface_address
.
len
=
4
;
memcpy
(
subnet
->
interface_address
.
iabuf
,
if
(
subnet
->
interface_address
.
len
==
0
)
{
if
(
tmp
->
address_count
>
0
)
{
subnet
->
interface_address
.
len
=
4
;
memcpy
(
subnet
->
interface_address
.
iabuf
,
&
tmp
->
addresses
[
0
].
s_addr
,
4
);
}
else
if
(
tmp
->
v6address_count
>
0
)
{
subnet
->
interface_address
.
len
=
16
;
memcpy
(
subnet
->
interface_address
.
iabuf
,
&
tmp
->
v6addresses
[
0
].
s6_addr
,
16
);
}
else
{
/* XXX: should be one */
log_error
(
"%s missing an interface "
"address"
,
tmp
->
name
);
continue
;
}
}
}
...
...
Write
Preview
Supports
Markdown
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