Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6d35bbea
Commit
6d35bbea
authored
May 02, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Fix ip_rt_acct reading.
parent
8b1309d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
net/ipv4/route.c
net/ipv4/route.c
+22
-11
No files found.
net/ipv4/route.c
View file @
6d35bbea
...
@@ -2605,17 +2605,28 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
...
@@ -2605,17 +2605,28 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
*
eof
=
1
;
*
eof
=
1
;
}
}
/* Copy first cpu. */
offset
/=
sizeof
(
u32
);
*
start
=
buffer
;
memcpy
(
buffer
,
IP_RT_ACCT_CPU
(
0
),
length
);
if
(
length
>
0
)
{
u32
*
src
=
((
u32
*
)
IP_RT_ACCT_CPU
(
0
))
+
offset
;
/* Add the other cpus in, one int at a time */
u32
*
dst
=
(
u32
*
)
buffer
;
for
(
i
=
1
;
i
<
NR_CPUS
;
i
++
)
{
unsigned
int
j
;
/* Copy first cpu. */
if
(
!
cpu_online
(
i
))
*
start
=
buffer
;
continue
;
memcpy
(
dst
,
src
,
length
);
for
(
j
=
0
;
j
<
length
/
4
;
j
++
)
((
u32
*
)
buffer
)[
j
]
+=
((
u32
*
)
IP_RT_ACCT_CPU
(
i
))[
j
];
/* Add the other cpus in, one int at a time */
for
(
i
=
1
;
i
<
NR_CPUS
;
i
++
)
{
unsigned
int
j
;
if
(
!
cpu_online
(
i
))
continue
;
src
=
((
u32
*
)
IP_RT_ACCT_CPU
(
i
))
+
offset
;
for
(
j
=
0
;
j
<
length
/
4
;
j
++
)
dst
[
j
]
+=
src
[
j
];
}
}
}
return
length
;
return
length
;
}
}
...
...
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