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
b1b0c245
Commit
b1b0c245
authored
Oct 01, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lift handling of SIOCIW... out of dev_ioctl()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4cf808e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
25 deletions
+12
-25
include/net/wext.h
include/net/wext.h
+2
-2
net/core/dev_ioctl.c
net/core/dev_ioctl.c
+0
-18
net/socket.c
net/socket.c
+1
-1
net/wireless/wext-core.c
net/wireless/wext-core.c
+9
-4
No files found.
include/net/wext.h
View file @
b1b0c245
...
...
@@ -7,7 +7,7 @@
struct
net
;
#ifdef CONFIG_WEXT_CORE
int
wext_handle_ioctl
(
struct
net
*
net
,
struct
iwreq
*
iwr
,
unsigned
int
cmd
,
int
wext_handle_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
void
__user
*
arg
);
int
compat_wext_handle_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
unsigned
long
arg
);
...
...
@@ -15,7 +15,7 @@ int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
struct
iw_statistics
*
get_wireless_stats
(
struct
net_device
*
dev
);
int
call_commit_handler
(
struct
net_device
*
dev
);
#else
static
inline
int
wext_handle_ioctl
(
struct
net
*
net
,
struct
iwreq
*
iwr
,
unsigned
int
cmd
,
static
inline
int
wext_handle_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
void
__user
*
arg
)
{
return
-
EINVAL
;
...
...
net/core/dev_ioctl.c
View file @
b1b0c245
...
...
@@ -411,24 +411,6 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
if
(
cmd
==
SIOCGIFNAME
)
return
dev_ifname
(
net
,
(
struct
ifreq
__user
*
)
arg
);
/*
* Take care of Wireless Extensions. Unfortunately struct iwreq
* isn't a proper subset of struct ifreq (it's 8 byte shorter)
* so we need to treat it specially, otherwise applications may
* fault if the struct they're passing happens to land at the
* end of a mapped page.
*/
if
(
cmd
>=
SIOCIWFIRST
&&
cmd
<=
SIOCIWLAST
)
{
struct
iwreq
iwr
;
if
(
copy_from_user
(
&
iwr
,
arg
,
sizeof
(
iwr
)))
return
-
EFAULT
;
iwr
.
ifr_name
[
sizeof
(
iwr
.
ifr_name
)
-
1
]
=
0
;
return
wext_handle_ioctl
(
net
,
&
iwr
,
cmd
,
arg
);
}
if
(
copy_from_user
(
&
ifr
,
arg
,
sizeof
(
struct
ifreq
)))
return
-
EFAULT
;
...
...
net/socket.c
View file @
b1b0c245
...
...
@@ -1005,7 +1005,7 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
}
else
#ifdef CONFIG_WEXT_CORE
if
(
cmd
>=
SIOCIWFIRST
&&
cmd
<=
SIOCIWLAST
)
{
err
=
dev
_ioctl
(
net
,
cmd
,
argp
);
err
=
wext_handle
_ioctl
(
net
,
cmd
,
argp
);
}
else
#endif
switch
(
cmd
)
{
...
...
net/wireless/wext-core.c
View file @
b1b0c245
...
...
@@ -1035,18 +1035,23 @@ static int ioctl_standard_call(struct net_device * dev,
}
int
wext_handle_ioctl
(
struct
net
*
net
,
struct
iwreq
*
iwr
,
unsigned
int
cmd
,
void
__user
*
arg
)
int
wext_handle_ioctl
(
struct
net
*
net
,
unsigned
int
cmd
,
void
__user
*
arg
)
{
struct
iw_request_info
info
=
{
.
cmd
=
cmd
,
.
flags
=
0
};
struct
iwreq
iwr
;
int
ret
;
ret
=
wext_ioctl_dispatch
(
net
,
iwr
,
cmd
,
&
info
,
if
(
copy_from_user
(
&
iwr
,
arg
,
sizeof
(
iwr
)))
return
-
EFAULT
;
iwr
.
ifr_name
[
sizeof
(
iwr
.
ifr_name
)
-
1
]
=
0
;
ret
=
wext_ioctl_dispatch
(
net
,
&
iwr
,
cmd
,
&
info
,
ioctl_standard_call
,
ioctl_private_call
);
if
(
ret
>=
0
&&
IW_IS_GET
(
cmd
)
&&
copy_to_user
(
arg
,
iwr
,
sizeof
(
struct
iwreq
)))
copy_to_user
(
arg
,
&
iwr
,
sizeof
(
struct
iwreq
)))
return
-
EFAULT
;
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