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
397542b2
Commit
397542b2
authored
Sep 05, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug resulting in tight-loop when new interfaces arrive.
parent
0c38719f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/network.c
src/network.c
+8
-4
No files found.
src/network.c
View file @
397542b2
...
@@ -443,7 +443,7 @@ static int iface_allowed_v4(struct in_addr local, int if_index, char *label,
...
@@ -443,7 +443,7 @@ static int iface_allowed_v4(struct in_addr local, int if_index, char *label,
int
enumerate_interfaces
(
int
reset
)
int
enumerate_interfaces
(
int
reset
)
{
{
static
struct
addrlist
*
spare
=
NULL
;
static
struct
addrlist
*
spare
=
NULL
;
static
int
done
=
0
;
static
int
done
=
0
,
active
=
0
;
struct
iface_param
param
;
struct
iface_param
param
;
int
errsave
,
ret
=
1
;
int
errsave
,
ret
=
1
;
struct
addrlist
*
addr
,
*
tmp
;
struct
addrlist
*
addr
,
*
tmp
;
...
@@ -451,18 +451,21 @@ int enumerate_interfaces(int reset)
...
@@ -451,18 +451,21 @@ int enumerate_interfaces(int reset)
/* Do this max once per select cycle - also inhibits netlink socket use
/* Do this max once per select cycle - also inhibits netlink socket use
in TCP child processes. */
in TCP child processes. */
if
(
reset
)
if
(
reset
)
{
{
done
=
0
;
done
=
0
;
return
1
;
return
1
;
}
}
if
(
done
)
if
(
done
||
active
)
return
1
;
return
1
;
done
=
1
;
done
=
1
;
/* protect against recusive calls from iface_enumerate(); */
active
=
1
;
if
((
param
.
fd
=
socket
(
PF_INET
,
SOCK_DGRAM
,
0
))
==
-
1
)
if
((
param
.
fd
=
socket
(
PF_INET
,
SOCK_DGRAM
,
0
))
==
-
1
)
return
0
;
return
0
;
...
@@ -504,7 +507,8 @@ int enumerate_interfaces(int reset)
...
@@ -504,7 +507,8 @@ int enumerate_interfaces(int reset)
errno
=
errsave
;
errno
=
errsave
;
spare
=
param
.
spare
;
spare
=
param
.
spare
;
active
=
0
;
return
ret
;
return
ret
;
}
}
...
...
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