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
Kirill Smelkov
linux
Commits
ca6b8bb0
Commit
ca6b8bb0
authored
Feb 03, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Support compat SIOCGETVIFCNT ioctl in ipv4.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
0033d5ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
net/ipv4/ipmr.c
net/ipv4/ipmr.c
+30
-0
No files found.
net/ipv4/ipmr.c
View file @
ca6b8bb0
...
...
@@ -1444,9 +1444,19 @@ struct compat_sioc_sg_req {
compat_ulong_t
wrong_if
;
};
struct
compat_sioc_vif_req
{
vifi_t
vifi
;
/* Which iface */
compat_ulong_t
icount
;
compat_ulong_t
ocount
;
compat_ulong_t
ibytes
;
compat_ulong_t
obytes
;
};
int
ipmr_compat_ioctl
(
struct
sock
*
sk
,
unsigned
int
cmd
,
void
__user
*
arg
)
{
struct
compat_sioc_sg_req
sr
;
struct
compat_sioc_vif_req
vr
;
struct
vif_device
*
vif
;
struct
mfc_cache
*
c
;
struct
net
*
net
=
sock_net
(
sk
);
struct
mr_table
*
mrt
;
...
...
@@ -1456,6 +1466,26 @@ int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
return
-
ENOENT
;
switch
(
cmd
)
{
case
SIOCGETVIFCNT
:
if
(
copy_from_user
(
&
vr
,
arg
,
sizeof
(
vr
)))
return
-
EFAULT
;
if
(
vr
.
vifi
>=
mrt
->
maxvif
)
return
-
EINVAL
;
read_lock
(
&
mrt_lock
);
vif
=
&
mrt
->
vif_table
[
vr
.
vifi
];
if
(
VIF_EXISTS
(
mrt
,
vr
.
vifi
))
{
vr
.
icount
=
vif
->
pkt_in
;
vr
.
ocount
=
vif
->
pkt_out
;
vr
.
ibytes
=
vif
->
bytes_in
;
vr
.
obytes
=
vif
->
bytes_out
;
read_unlock
(
&
mrt_lock
);
if
(
copy_to_user
(
arg
,
&
vr
,
sizeof
(
vr
)))
return
-
EFAULT
;
return
0
;
}
read_unlock
(
&
mrt_lock
);
return
-
EADDRNOTAVAIL
;
case
SIOCGETSGCNT
:
if
(
copy_from_user
(
&
sr
,
arg
,
sizeof
(
sr
)))
return
-
EFAULT
;
...
...
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