]> Pileus Git - ~andy/linux/blobdiff - net/phonet/pn_dev.c
net: force bridge module(s) to be GPL
[~andy/linux] / net / phonet / pn_dev.c
index c2b77a698695371a5b08d2da94876ff2a71f50c7..5ae4c01e8388d5db0ab7d0322857cf9dd86ed319 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/net.h>
 #include <linux/netdevice.h>
 #include <linux/phonet.h>
+#include <linux/proc_fs.h>
 #include <net/sock.h>
 #include <net/netns/generic.h>
 #include <net/phonet/pn_dev.h>
@@ -218,6 +219,11 @@ static int phonet_init_net(struct net *net)
        if (!pnn)
                return -ENOMEM;
 
+       if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops)) {
+               kfree(pnn);
+               return -ENOMEM;
+       }
+
        INIT_LIST_HEAD(&pnn->pndevs.list);
        spin_lock_init(&pnn->pndevs.lock);
        net_assign_generic(net, phonet_net_id, pnn);
@@ -233,6 +239,8 @@ static void phonet_exit_net(struct net *net)
        for_each_netdev(net, dev)
                phonet_device_destroy(dev);
        rtnl_unlock();
+
+       proc_net_remove(net, "phonet");
        kfree(pnn);
 }