]> err.no Git - linux-2.6/blobdiff - drivers/net/pppoe.c
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / drivers / net / pppoe.c
index a005d8f4c38e545e80237abbcb83cdba34e161e3..58a26a47af29a1ee3764968dda5e7497752c9e7a 100644 (file)
@@ -301,7 +301,7 @@ static int pppoe_device_event(struct notifier_block *this,
 {
        struct net_device *dev = (struct net_device *) ptr;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                return NOTIFY_DONE;
 
        /* Only look at sockets that are using this specific device. */
@@ -392,7 +392,7 @@ static int pppoe_rcv(struct sk_buff *skb,
        if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
                goto out;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                goto drop;
 
        if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
@@ -424,7 +424,7 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
        struct pppoe_hdr *ph;
        struct pppox_sock *po;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                goto abort;
 
        if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
@@ -989,6 +989,7 @@ out:
 }
 
 static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(pppoe_hash_lock)
 {
        loff_t l = *pos;
 
@@ -1022,6 +1023,7 @@ out:
 }
 
 static void pppoe_seq_stop(struct seq_file *seq, void *v)
+       __releases(pppoe_hash_lock)
 {
        read_unlock_bh(&pppoe_hash_lock);
 }
@@ -1050,11 +1052,9 @@ static int __init pppoe_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("pppoe", S_IRUGO, init_net.proc_net);
+       p = proc_net_fops_create(&init_net, "pppoe", S_IRUGO, &pppoe_seq_fops);
        if (!p)
                return -ENOMEM;
-
-       p->proc_fops = &pppoe_seq_fops;
        return 0;
 }
 #else /* CONFIG_PROC_FS */