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
06870e11
Commit
06870e11
authored
Oct 20, 2002
by
Matthew Wilcox
Committed by
David S. Miller
Oct 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Move more ioctls to top level.
parent
1ad2be64
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
117 deletions
+63
-117
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+0
-77
net/netsyms.c
net/netsyms.c
+2
-5
net/packet/af_packet.c
net/packet/af_packet.c
+0
-33
net/socket.c
net/socket.c
+61
-0
net/wanrouter/af_wanpipe.c
net/wanrouter/af_wanpipe.c
+0
-2
No files found.
net/ipv4/af_inet.c
View file @
06870e11
...
...
@@ -111,13 +111,6 @@
#ifdef CONFIG_IP_MROUTE
#include <linux/mroute.h>
#endif
#include <linux/if_bridge.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#ifdef CONFIG_NET_DIVERT
#include <linux/divert.h>
#endif
/* CONFIG_NET_DIVERT */
struct
linux_mib
net_statistics
[
NR_CPUS
*
2
];
...
...
@@ -127,22 +120,6 @@ atomic_t inet_sock_nr;
extern
void
ip_mc_drop_socket
(
struct
sock
*
sk
);
#ifdef CONFIG_DLCI
extern
int
dlci_ioctl
(
unsigned
int
,
void
*
);
#endif
#ifdef CONFIG_DLCI_MODULE
int
(
*
dlci_ioctl_hook
)(
unsigned
int
,
void
*
);
#endif
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
int
(
*
br_ioctl_hook
)(
unsigned
long
);
#endif
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
int
(
*
vlan_ioctl_hook
)(
unsigned
long
arg
);
#endif
/* Per protocol sock slabcache */
kmem_cache_t
*
tcp_sk_cachep
;
static
kmem_cache_t
*
udp_sk_cachep
;
...
...
@@ -890,60 +867,6 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case
SIOCSIFFLAGS
:
err
=
devinet_ioctl
(
cmd
,
(
void
*
)
arg
);
break
;
case
SIOCGIFBR
:
case
SIOCSIFBR
:
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
#ifdef CONFIG_KMOD
if
(
!
br_ioctl_hook
)
request_module
(
"bridge"
);
#endif
if
(
br_ioctl_hook
)
err
=
br_ioctl_hook
(
arg
);
else
#endif
err
=
-
ENOPKG
;
break
;
case
SIOCGIFVLAN
:
case
SIOCSIFVLAN
:
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#ifdef CONFIG_KMOD
if
(
!
vlan_ioctl_hook
)
request_module
(
"8021q"
);
#endif
if
(
vlan_ioctl_hook
)
err
=
vlan_ioctl_hook
(
arg
);
else
#endif
err
=
-
ENOPKG
;
break
;
case
SIOCGIFDIVERT
:
case
SIOCSIFDIVERT
:
#ifdef CONFIG_NET_DIVERT
err
=
divert_ioctl
(
cmd
,
(
struct
divert_cf
*
)
arg
);
#else
err
=
-
ENOPKG
;
#endif
/* CONFIG_NET_DIVERT */
break
;
case
SIOCADDDLCI
:
case
SIOCDELDLCI
:
#ifdef CONFIG_DLCI
lock_kernel
();
err
=
dlci_ioctl
(
cmd
,
(
void
*
)
arg
);
unlock_kernel
();
break
;
#elif CONFIG_DLCI_MODULE
#ifdef CONFIG_KMOD
if
(
!
dlci_ioctl_hook
)
request_module
(
"dlci"
);
#endif
if
(
dlci_ioctl_hook
)
{
lock_kernel
();
err
=
(
*
dlci_ioctl_hook
)(
cmd
,
(
void
*
)
arg
);
unlock_kernel
();
}
else
#endif
err
=
-
ENOPKG
;
break
;
default:
if
(
!
sk
->
prot
->
ioctl
||
(
err
=
sk
->
prot
->
ioctl
(
sk
,
cmd
,
arg
))
==
...
...
net/netsyms.c
View file @
06870e11
...
...
@@ -221,22 +221,19 @@ EXPORT_SYMBOL(destroy_EII_client);
/* for 801q VLAN support */
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
EXPORT_SYMBOL
(
dev_change_flags
);
EXPORT_SYMBOL
(
vlan_ioctl_hook
);
#endif
EXPORT_SYMBOL
(
vlan_ioctl_hook
);
EXPORT_SYMBOL
(
scm_detach_fds
);
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
EXPORT_SYMBOL
(
br_handle_frame_hook
);
#ifdef CONFIG_INET
EXPORT_SYMBOL
(
br_ioctl_hook
);
#endif
#endif
EXPORT_SYMBOL
(
br_ioctl_hook
);
#ifdef CONFIG_NET_DIVERT
EXPORT_SYMBOL
(
alloc_divert_blk
);
EXPORT_SYMBOL
(
free_divert_blk
);
EXPORT_SYMBOL
(
divert_ioctl
);
#endif
/* CONFIG_NET_DIVERT */
#ifdef CONFIG_INET
...
...
net/packet/af_packet.c
View file @
06870e11
...
...
@@ -67,20 +67,11 @@
#include <linux/poll.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/if_bridge.h>
#ifdef CONFIG_NET_DIVERT
#include <linux/divert.h>
#endif
/* CONFIG_NET_DIVERT */
#ifdef CONFIG_INET
#include <net/inet_common.h>
#endif
#ifdef CONFIG_DLCI
extern
int
dlci_ioctl
(
unsigned
int
,
void
*
);
#endif
#define CONFIG_SOCK_PACKET 1
/*
...
...
@@ -1491,28 +1482,6 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
case
SIOCSIFHWBROADCAST
:
return
(
dev_ioctl
(
cmd
,(
void
*
)
arg
));
case
SIOCGIFBR
:
case
SIOCSIFBR
:
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
#ifdef CONFIG_INET
#ifdef CONFIG_KMOD
if
(
br_ioctl_hook
==
NULL
)
request_module
(
"bridge"
);
#endif
if
(
br_ioctl_hook
!=
NULL
)
return
br_ioctl_hook
(
arg
);
#endif
#endif
return
-
ENOPKG
;
case
SIOCGIFDIVERT
:
case
SIOCSIFDIVERT
:
#ifdef CONFIG_NET_DIVERT
return
divert_ioctl
(
cmd
,
(
struct
divert_cf
*
)
arg
);
#else
return
-
ENOPKG
;
#endif
/* CONFIG_NET_DIVERT */
#ifdef CONFIG_INET
case
SIOCADDRT
:
case
SIOCDELRT
:
...
...
@@ -1528,8 +1497,6 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
case
SIOCGIFDSTADDR
:
case
SIOCSIFDSTADDR
:
case
SIOCSIFFLAGS
:
case
SIOCADDDLCI
:
case
SIOCDELDLCI
:
return
inet_dgram_ops
.
ioctl
(
sock
,
cmd
,
arg
);
#endif
...
...
net/socket.c
View file @
06870e11
...
...
@@ -74,6 +74,8 @@
#include <linux/cache.h>
#include <linux/module.h>
#include <linux/highmem.h>
#include <linux/wireless.h>
#include <linux/divert.h>
#if defined(CONFIG_KMOD) && defined(CONFIG_NET)
#include <linux/kmod.h>
...
...
@@ -708,6 +710,15 @@ static ssize_t sock_writev(struct file *file, const struct iovec *vector,
file
,
vector
,
count
,
tot_len
);
}
int
(
*
br_ioctl_hook
)(
unsigned
long
arg
);
int
(
*
vlan_ioctl_hook
)(
unsigned
long
arg
);
#ifdef CONFIG_DLCI
extern
int
dlci_ioctl
(
unsigned
int
,
void
*
);
#else
int
(
*
dlci_ioctl_hook
)(
unsigned
int
,
void
*
);
#endif
/*
* With an ioctl, arg may well be a user mode pointer, but we don't know
* what to do with it - that's up to the protocol still.
...
...
@@ -743,6 +754,56 @@ int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case
SIOCGPGRP
:
err
=
put_user
(
sock
->
file
->
f_owner
.
pid
,
(
int
*
)
arg
);
break
;
case
SIOCGIFBR
:
case
SIOCSIFBR
:
err
=
-
ENOPKG
;
#ifdef CONFIG_KMOD
if
(
!
br_ioctl_hook
)
request_module
(
"bridge"
);
#endif
if
(
br_ioctl_hook
)
err
=
br_ioctl_hook
(
arg
);
break
;
case
SIOCGIFVLAN
:
case
SIOCSIFVLAN
:
err
=
-
ENOPKG
;
#ifdef CONFIG_KMOD
if
(
!
vlan_ioctl_hook
)
request_module
(
"8021q"
);
#endif
if
(
vlan_ioctl_hook
)
err
=
vlan_ioctl_hook
(
arg
);
break
;
case
SIOCGIFDIVERT
:
case
SIOCSIFDIVERT
:
/* Convert this to call through a hook */
#ifdef CONFIG_NET_DIVERT
err
=
divert_ioctl
(
cmd
,
(
struct
divert_cf
*
)
arg
);
#else
err
=
-
ENOPKG
;
#endif
/* CONFIG_NET_DIVERT */
break
;
case
SIOCADDDLCI
:
case
SIOCDELDLCI
:
/* Convert this to always call through a hook */
#ifdef CONFIG_DLCI
lock_kernel
();
err
=
dlci_ioctl
(
cmd
,
(
void
*
)
arg
);
unlock_kernel
();
break
;
#else
err
=
-
ENOPKG
;
#ifdef CONFIG_KMOD
if
(
!
dlci_ioctl_hook
)
request_module
(
"dlci"
);
#endif
if
(
dlci_ioctl_hook
)
{
lock_kernel
();
err
=
dlci_ioctl_hook
(
cmd
,
(
void
*
)
arg
);
unlock_kernel
();
}
#endif
break
;
default:
err
=
sock
->
ops
->
ioctl
(
sock
,
cmd
,
arg
);
break
;
...
...
net/wanrouter/af_wanpipe.c
View file @
06870e11
...
...
@@ -1964,8 +1964,6 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
case
SIOCGIFDSTADDR
:
case
SIOCSIFDSTADDR
:
case
SIOCSIFFLAGS
:
case
SIOCADDDLCI
:
case
SIOCDELDLCI
:
return
inet_dgram_ops
.
ioctl
(
sock
,
cmd
,
arg
);
#endif
...
...
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