o packet: use revised net module infrastructure

Using sk_set_owner and having THIS_MODULE in the struct proto_ops registered
with the core.
parent 31abe81c
...@@ -950,6 +950,7 @@ static int packet_create(struct socket *sock, int protocol) ...@@ -950,6 +950,7 @@ static int packet_create(struct socket *sock, int protocol)
sock->ops = &packet_ops_spkt; sock->ops = &packet_ops_spkt;
#endif #endif
sock_init_data(sock,sk); sock_init_data(sock,sk);
sk_set_owner(sk, THIS_MODULE);
po = pkt_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL); po = pkt_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
if (!po) if (!po)
...@@ -1705,7 +1706,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st ...@@ -1705,7 +1706,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
#ifdef CONFIG_SOCK_PACKET #ifdef CONFIG_SOCK_PACKET
struct proto_ops packet_ops_spkt = { struct proto_ops packet_ops_spkt = {
.family = PF_PACKET, .family = PF_PACKET,
.owner = THIS_MODULE,
.release = packet_release, .release = packet_release,
.bind = packet_bind_spkt, .bind = packet_bind_spkt,
.connect = sock_no_connect, .connect = sock_no_connect,
...@@ -1727,7 +1728,7 @@ struct proto_ops packet_ops_spkt = { ...@@ -1727,7 +1728,7 @@ struct proto_ops packet_ops_spkt = {
struct proto_ops packet_ops = { struct proto_ops packet_ops = {
.family = PF_PACKET, .family = PF_PACKET,
.owner = THIS_MODULE,
.release = packet_release, .release = packet_release,
.bind = packet_bind, .bind = packet_bind,
.connect = sock_no_connect, .connect = sock_no_connect,
......
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