o ipv6: use revised net module infrastructure

Using sk_set_owner and having THIS_MODULE in the struct proto_ops
registered with the core, also remove the MOD_{INC,DEC}_USE_COUNT,
as they are not needed anymore with this new net module infrastructure
for struct sock and struct socket. (well, see the netdev discussion :)
parent c76abddf
...@@ -193,6 +193,7 @@ static int inet6_create(struct socket *sock, int protocol) ...@@ -193,6 +193,7 @@ static int inet6_create(struct socket *sock, int protocol)
sock->ops = answer->ops; sock->ops = answer->ops;
sock_init_data(sock, sk); sock_init_data(sock, sk);
sk_set_owner(sk, THIS_MODULE);
sk->prot = answer->prot; sk->prot = answer->prot;
sk->no_check = answer->no_check; sk->no_check = answer->no_check;
...@@ -498,7 +499,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -498,7 +499,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct proto_ops inet6_stream_ops = { struct proto_ops inet6_stream_ops = {
.family = PF_INET6, .family = PF_INET6,
.owner = THIS_MODULE,
.release = inet6_release, .release = inet6_release,
.bind = inet6_bind, .bind = inet6_bind,
.connect = inet_stream_connect, /* ok */ .connect = inet_stream_connect, /* ok */
...@@ -519,7 +520,7 @@ struct proto_ops inet6_stream_ops = { ...@@ -519,7 +520,7 @@ struct proto_ops inet6_stream_ops = {
struct proto_ops inet6_dgram_ops = { struct proto_ops inet6_dgram_ops = {
.family = PF_INET6, .family = PF_INET6,
.owner = THIS_MODULE,
.release = inet6_release, .release = inet6_release,
.bind = inet6_bind, .bind = inet6_bind,
.connect = inet_dgram_connect, /* ok */ .connect = inet_dgram_connect, /* ok */
......
...@@ -1308,7 +1308,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1308,7 +1308,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#ifdef INET_REFCNT_DEBUG #ifdef INET_REFCNT_DEBUG
atomic_inc(&inet6_sock_nr); atomic_inc(&inet6_sock_nr);
#endif #endif
MOD_INC_USE_COUNT;
/* It is tricky place. Until this moment IPv4 tcp /* It is tricky place. Until this moment IPv4 tcp
worked with IPv6 af_tcp.af_specific. worked with IPv6 af_tcp.af_specific.
...@@ -1358,7 +1357,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1358,7 +1357,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#ifdef INET_REFCNT_DEBUG #ifdef INET_REFCNT_DEBUG
atomic_inc(&inet6_sock_nr); atomic_inc(&inet6_sock_nr);
#endif #endif
MOD_INC_USE_COUNT;
ip6_dst_store(newsk, dst, NULL); ip6_dst_store(newsk, dst, NULL);
sk->route_caps = dst->dev->features&~(NETIF_F_IP_CSUM|NETIF_F_TSO); sk->route_caps = dst->dev->features&~(NETIF_F_IP_CSUM|NETIF_F_TSO);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment