Assign inet transport sockets to the right module
Subsystems (6)
PATCH 1/1 Assign inet transport sockets to the right module
Hi David,
Please take a look if it makes sense, if so please pull from:
bk://kernel.bkbits.net/acme/sock-2.6
Regards,
- Arnaldo
===================================================================
[email protected], 2004-11-15 04:05:17-02:00, [email protected]
[NET] Assign inet transport sockets to the right module
This is another case where when all the protocols use sk->sk_prot we can remove another member from struct sock, sk->sk_owner, instead using the sk->sk_prot->owner, i.e. this property is not per socket instance, but per protocol.
include/net/sock.h | 2 ++ net/ipv4/af_inet.c | 2 +- net/ipv4/raw.c | 1 + net/ipv4/tcp_ipv4.c | 1 + net/ipv4/udp.c | 1 + net/ipv6/af_inet6.c | 2 +- net/ipv6/raw.c | 1 + net/ipv6/tcp_ipv6.c | 1 + net/ipv6/udp.c | 1 + net/sctp/socket.c | 2 ++ 10 files changed, 12 insertions(+), 2 deletions(-)
include/net/sock.h +2 -0
@@ -556,6 +556,8 @@kmem_cache_t *slab;int slab_obj_size; +struct module *owner; +char name[32 ];struct {
net/ipv4/af_inet.c +1 -1
@@ -309,7 +309,7 @@ inet->id =0 ;sock_init_data (sock, sk); -sk_set_owner (sk,THIS_MODULE ); +sk_set_owner (sk, sk->sk_prot->owner); sk->sk_destruct = inet_sock_destruct; sk->sk_family =PF_INET ;
net/ipv4/raw.c +1 -0
@@ -706,6 +706,7 @@struct proto raw_prot = { .name ="RAW" , + .owner =THIS_MODULE , .close = raw_close, .connect = ip4_datagram_connect, .disconnect = udp_disconnect,
net/ipv4/tcp_ipv4.c +1 -0
@@ -2598,6 +2598,7 @@struct proto tcp_prot = { .name ="TCP" , + .owner =THIS_MODULE , .close = tcp_close, .connect = tcp_v4_connect, .disconnect = tcp_disconnect,
net/ipv4/udp.c +1 -0
@@ -1306,6 +1306,7 @@struct proto udp_prot = { .name ="UDP" , + .owner =THIS_MODULE , .close = udp_close, .connect = ip4_datagram_connect, .disconnect = udp_disconnect,
net/ipv6/af_inet6.c +1 -1
@@ -174,7 +174,7 @@ goto out;sock_init_data (sock, sk); -sk_set_owner (sk,THIS_MODULE ); +sk_set_owner (sk, sk->sk_prot->owner); rc =0 ; sk->sk_prot = answer_prot;
net/ipv6/raw.c +1 -0
@@ -975,6 +975,7 @@struct proto rawv6_prot = { .name ="RAW" , + .owner =THIS_MODULE , .close = rawv6_close, .connect = ip6_datagram_connect, .disconnect = udp_disconnect,
net/ipv6/tcp_ipv6.c +1 -0
@@ -2132,6 +2132,7 @@struct proto tcpv6_prot = { .name ="TCPv6" , + .owner =THIS_MODULE , .close = tcp_close, .connect = tcp_v6_connect, .disconnect = tcp_disconnect,
net/ipv6/udp.c +1 -0
@@ -1033,6 +1033,7 @@struct proto udpv6_prot = { .name ="UDP" , + .owner =THIS_MODULE , .close = udpv6_close, .connect = ip6_datagram_connect, .disconnect = udp_disconnect,
net/sctp/socket.c +2 -0
@@ -4652,6 +4652,7 @@/* This proto struct describes the ULP interface for SCTP. */ struct proto sctp_prot = { .name ="SCTP" , + .owner =THIS_MODULE , .close = sctp_close, .connect = sctp_connect, .disconnect = sctp_disconnect,
@@ -4675,6 +4676,7 @@#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE )struct proto sctpv6_prot = { .name ="SCTPv6" , + .owner =THIS_MODULE , .close = sctp_close, .connect = sctp_connect, .disconnect = sctp_disconnect,
David S. Miller
maintainerQuoted 5 lines · On Mon, 15 Nov 2004 04:19:34 -0200 Arnaldo Carvalho de Melo…
Hi David,
Please take a look if it makes sense, if so please pull from:
bk://kernel.bkbits.net/acme/sock-2.6
Ok, but deferred to 2.6.11
Quoted 4 lines · David S. Miller
On Mon, 15 Nov 2004 04:19:34 -0200
Arnaldo Carvalho de Melo <[email protected]> wrote:
Quoted 8 lines
Quoted 5 lines
Hi David,
Please take a look if it makes sense, if so please pull from:
bk://kernel.bkbits.net/acme/sock-2.6
Ok, but deferred to 2.6.11
Not a problem, I have lots of other patches, I submitted this one just because it was more like a fix than a cleanup :-)
- Arnaldo
David S. Miller
maintainerQuoted 3 lines · On Mon, 15 Nov 2004 04:19:34 -0200 Arnaldo Carvalho de Melo…
Please take a look if it makes sense, if so please pull from:
bk://kernel.bkbits.net/acme/sock-2.6
This really does fix bugs, so I've pulled it into my 2.6.10 pending tree.
Thanks a lot Arnaldo.