| Age | Commit message (Collapse) | Author |
|
sk_alloc_slab becomes proto_register, that receives a struct proto not necessarily
completely filled, but at least with the proto name, owner and obj_size (aka proto
specific sock size), with this we can remove the struct sock sk_owner and sk_slab,
using sk->sk_prot->{owner,slab} instead.
This patch also makes sk_set_owner not necessary anymore, as at sk_alloc time we
have now access to the struct proto onwer and slab members, so we can bump the
module refcount exactly at sock allocation time.
Another nice "side effect" is that this patch removes the generic sk_cachep slab
cache, making the only last two protocols that used it use just kmalloc, informing
a struct proto obj_size equal to sizeof(struct sock).
Ah, almost forgot that with this patch it is very easy to use a slab cache, as it is
now created at proto_register time, and all protocols need to use proto_register,
so its just a matter of switching the second parameter of proto_register to '1', heck,
this can be done even at module load time with some small additional patch.
Another optimization that will be possible in the future is to move the sk_protocol
and sk_type struct sock members to struct proto, but this has to wait for all protocols
to move completely to sk_prot.
This changeset also introduces /proc/net/protocols, that lists the registered protocols
details, some may seem excessive, but I'd like to keep them while working on further
struct sock hierarchy work and also to realize which protocols are old ones, i.e. that
still use struct proto_ops, etc, yeah, this is a bit of an exaggeration, as all protos
still use struct proto_ops, but in time the idea is to move all to use sk->sk_prot and
make the proto_ops infrastructure be shared among all protos, reducing one level of
indirection.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
into sunset.davemloft.net:/home/davem/src/BK/acme-2.6
|
|
Below patch puts struct sock into rose_cb to get rid of the need for the
use of sk_protinfo in rose_sk(). While we're touching the data structure
convert it from a typedef into a struct.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Replacing the open coded equivalent.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
ROSE wasn't verifying the ndigis argument of a new route resulting in a
minor security hole.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Use the new lock initializers DEFINE_SPIN_LOCk and DEFINE_RW_LOCK
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Added ->peer to struct unix_sock
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@redhat.com>
|
|
Switch to module_param and the hash list can be local.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@redhat.com>
|
|
Fix deadlock in rose_del_loopback_node(). Found by the Stanford locking
checker.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@redhat.com>
|
|
|
|
|
|
dev_ioctl() has a __user pointer argument; however, its declaration
lacks that and callers are also wrong. Declaration fixed, callers updated.
|
|
|
|
optval (and in case of getsockopt - optlen) made __user, changes
percolated down into the instances.
|
|
|
|
|
|
|
|
|
|
- Fix socket locking in ax25
- Fix waitqueue handling bug in ax25
- Use sock_orphan in ax25
- Fix waitqueue handling bug in netrom and rose too
- Fix raw socket behavior in ax25
|
|
Also, fix a object size vs. pointer size thinko.
|
|
|
|
|
|
Previously, default aliases were hardwired into modutils. Now they
should be inside the modules, using MODULE_ALIAS() (they will be overridden
by any user alias).
|
|
|
|
Replace kfree with free_netdev in cleanup routines
of protocols and network pseudo drivers.
|
|
The existing ROSE /proc interface has no module owner, and doesn't check for
bounds overflow. Easier to just convert it to the seq_file wrapper functions.
This patch is against 2.6.0-test2 (offsets assume earlier patch).
|
|
This patch changes the ROSE protocol to allocate an array of pointers and each network device
separately. This sets up later change where network_device object's are released on last use
which may be after the module is unloaded.
The patch is against 2.6.0-test2 (though this code hasn't changed in a long time).
Allocation is done via alloc_netdev so the dev->priv area is already reserved and
doesn't need to be allocated separately.
|
|
|
|
These small patches remove a number of '.maxlen = 0,' initializers.
|
|
|
|
With this the data dependency is reduced to just making sure that the first
member of both struct sock and struct tcp_tw_bucket are a struct sock_common.
Also makes it easier to grep for struct sock and struct tcp_tw_bucket usage in
the tree as all the members in those structs are prefixed, respectively, with
sk_ and tw_, like struct inode (i_), struct block_device (bd_), etc.
Checked namespace with make tags/ctags, just one colision with the macros for
the struct sock members, with a wanrouter struct, fixed that
s/sk_state/state_sk/g in the wanrouter struct.
Checked as well if the names of the members in both structs collided with some
macro, none found.
|
|
|
|
This makes:
1. simpler primitive to access struct sock flags, shorter
2. we check if the flag is valid by using enum sock_flags
3. we can change the implementation to an open coded bit operations
if it proves to be faster than the more general bit manipulation
routines now used, i.e. we only have to change sock.h, not the
whole net tree like now
|
|
Using THIS_MODULE in the struct proto_ops registered with the core.
|
|
|
|
Now the core networking infrastructure will (finally) do that for the net
protocol families, its just a matter of setting the ->owner field in the
registered struct net_proto_family to THIS_MODULE.
|
|
|
|
compat syscalls.
1) Pull scm argument from sendmsg/recvmsg, it is available
from I/O control block
2) Consolidate networking syscall compat call into net/compat.c
3) Change ops->{sendmsg,recvmsg}() code sequences into sock_{sendmsg,recvmsg}()
|
|
Hortas.
|
|
|
|
|
|
Makefiles no longer need to include Rules.make, which is currently an
empty file. This patch removes it from the remaining Makefiles, and
removes the empty Rules.make file.
|
|
Traditionally, the individual components of a multipart module are
listed in <mod>-objs. Allow for using <mod>-y as well, as that turns
out to simplify declaring optional parts of multi-part modules, see
the converted examples in net/*/Makefile.
This change is backwards-compatible, i.e. not converted Makefiles
still work just fine.
|
|
|
|
|
|
|