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
d917275e
Commit
d917275e
authored
Jan 04, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix botch in new arp-cache linked-list code resulting in 100% CPU spin.
parent
cc7cb0b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
src/arp.c
src/arp.c
+14
-10
No files found.
src/arp.c
View file @
d917275e
...
@@ -110,7 +110,7 @@ static int filter_mac(int family, char *addrp, char *mac, size_t maclen, void *p
...
@@ -110,7 +110,7 @@ static int filter_mac(int family, char *addrp, char *mac, size_t maclen, void *p
/* If in lazy mode, we cache absence of ARP entries. */
/* If in lazy mode, we cache absence of ARP entries. */
int
find_mac
(
union
mysockaddr
*
addr
,
unsigned
char
*
mac
,
int
lazy
,
time_t
now
)
int
find_mac
(
union
mysockaddr
*
addr
,
unsigned
char
*
mac
,
int
lazy
,
time_t
now
)
{
{
struct
arp_record
*
arp
,
**
up
;
struct
arp_record
*
arp
,
*
tmp
,
*
*
up
;
int
updated
=
0
;
int
updated
=
0
;
again:
again:
...
@@ -155,16 +155,20 @@ int find_mac(union mysockaddr *addr, unsigned char *mac, int lazy, time_t now)
...
@@ -155,16 +155,20 @@ int find_mac(union mysockaddr *addr, unsigned char *mac, int lazy, time_t now)
iface_enumerate
(
AF_UNSPEC
,
NULL
,
filter_mac
);
iface_enumerate
(
AF_UNSPEC
,
NULL
,
filter_mac
);
/* Remove all unconfirmed entries to old list. */
/* Remove all unconfirmed entries to old list. */
for
(
arp
=
arps
,
up
=
&
arps
;
arp
;
arp
=
arp
->
next
)
for
(
arp
=
arps
,
up
=
&
arps
;
arp
;
arp
=
tmp
)
if
(
arp
->
status
==
ARP_MARK
)
{
{
tmp
=
arp
->
next
;
*
up
=
arp
->
next
;
arp
->
next
=
old
;
old
=
arp
;
}
else
up
=
&
arp
->
next
;
if
(
arp
->
status
==
ARP_MARK
)
{
*
up
=
arp
->
next
;
arp
->
next
=
old
;
old
=
arp
;
}
else
up
=
&
arp
->
next
;
}
goto
again
;
goto
again
;
}
}
...
...
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