Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
590d4693
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
590d4693
编写于
11月 18, 2013
作者:
B
Ben Hutchings
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
net/compat: Merge multiple implementations of ifreq::ifr_data conversion
Signed-off-by:
N
Ben Hutchings
<
bhutchings@solarflare.com
>
上级
417c3522
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
43 deletion
+6
-43
net/socket.c
net/socket.c
+6
-43
未找到文件。
net/socket.c
浏览文件 @
590d4693
...
...
@@ -2964,11 +2964,8 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
struct
compat_ifreq
__user
*
ifr32
)
{
struct
ifreq
kifr
;
struct
ifreq
__user
*
uifr
;
mm_segment_t
old_fs
;
int
err
;
u32
data
;
void
__user
*
datap
;
switch
(
cmd
)
{
case
SIOCBONDENSLAVE
:
...
...
@@ -2985,26 +2982,13 @@ static int bond_ioctl(struct net *net, unsigned int cmd,
set_fs
(
old_fs
);
return
err
;
case
SIOCBONDSLAVEINFOQUERY
:
case
SIOCBONDINFOQUERY
:
uifr
=
compat_alloc_user_space
(
sizeof
(
*
uifr
));
if
(
copy_in_user
(
&
uifr
->
ifr_name
,
&
ifr32
->
ifr_name
,
IFNAMSIZ
))
return
-
EFAULT
;
if
(
get_user
(
data
,
&
ifr32
->
ifr_ifru
.
ifru_data
))
return
-
EFAULT
;
datap
=
compat_ptr
(
data
);
if
(
put_user
(
datap
,
&
uifr
->
ifr_ifru
.
ifru_data
))
return
-
EFAULT
;
return
dev_ioctl
(
net
,
cmd
,
uifr
);
default:
return
-
ENOIOCTLCMD
;
}
}
static
int
siocdevprivate_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
/* Handle ioctls that use ifreq::ifr_data and just need struct ifreq converted */
static
int
compat_ifr_data_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
struct
compat_ifreq
__user
*
u_ifreq32
)
{
struct
ifreq
__user
*
u_ifreq64
;
...
...
@@ -3104,27 +3088,6 @@ static int compat_sioc_ifmap(struct net *net, unsigned int cmd,
return
err
;
}
static
int
compat_siocshwtstamp
(
struct
net
*
net
,
struct
compat_ifreq
__user
*
uifr32
)
{
void
__user
*
uptr
;
compat_uptr_t
uptr32
;
struct
ifreq
__user
*
uifr
;
uifr
=
compat_alloc_user_space
(
sizeof
(
*
uifr
));
if
(
copy_in_user
(
uifr
,
uifr32
,
sizeof
(
struct
compat_ifreq
)))
return
-
EFAULT
;
if
(
get_user
(
uptr32
,
&
uifr32
->
ifr_data
))
return
-
EFAULT
;
uptr
=
compat_ptr
(
uptr32
);
if
(
put_user
(
uptr
,
&
uifr
->
ifr_data
))
return
-
EFAULT
;
return
dev_ioctl
(
net
,
SIOCSHWTSTAMP
,
uifr
);
}
struct
rtentry32
{
u32
rt_pad1
;
struct
sockaddr
rt_dst
;
/* target address */
...
...
@@ -3236,7 +3199,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
struct
net
*
net
=
sock_net
(
sk
);
if
(
cmd
>=
SIOCDEVPRIVATE
&&
cmd
<=
(
SIOCDEVPRIVATE
+
15
))
return
siocdevprivate
_ioctl
(
net
,
cmd
,
argp
);
return
compat_ifr_data
_ioctl
(
net
,
cmd
,
argp
);
switch
(
cmd
)
{
case
SIOCSIFBR
:
...
...
@@ -3256,8 +3219,6 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
case
SIOCBONDENSLAVE
:
case
SIOCBONDRELEASE
:
case
SIOCBONDSETHWADDR
:
case
SIOCBONDSLAVEINFOQUERY
:
case
SIOCBONDINFOQUERY
:
case
SIOCBONDCHANGEACTIVE
:
return
bond_ioctl
(
net
,
cmd
,
argp
);
case
SIOCADDRT
:
...
...
@@ -3267,8 +3228,10 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
return
do_siocgstamp
(
net
,
sock
,
cmd
,
argp
);
case
SIOCGSTAMPNS
:
return
do_siocgstampns
(
net
,
sock
,
cmd
,
argp
);
case
SIOCBONDSLAVEINFOQUERY
:
case
SIOCBONDINFOQUERY
:
case
SIOCSHWTSTAMP
:
return
compat_
siocshwtstamp
(
net
,
argp
);
return
compat_
ifr_data_ioctl
(
net
,
cmd
,
argp
);
case
FIOSETOWN
:
case
SIOCSPGRP
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录