aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/clip.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/clip.c')
-rw-r--r--net/atm/clip.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c
index f92f9c94d2c7..7af2c411da82 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -2,7 +2,6 @@
2 2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5#include <linux/config.h>
6#include <linux/string.h> 5#include <linux/string.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/kernel.h> /* for UINT_MAX */ 7#include <linux/kernel.h> /* for UINT_MAX */
@@ -24,6 +23,7 @@
24#include <linux/if.h> /* for IFF_UP */ 23#include <linux/if.h> /* for IFF_UP */
25#include <linux/inetdevice.h> 24#include <linux/inetdevice.h>
26#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/poison.h>
27#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include <linux/rcupdate.h> 29#include <linux/rcupdate.h>
@@ -267,7 +267,7 @@ static void clip_neigh_destroy(struct neighbour *neigh)
267 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh); 267 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
268 if (NEIGH2ENTRY(neigh)->vccs) 268 if (NEIGH2ENTRY(neigh)->vccs)
269 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n"); 269 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
270 NEIGH2ENTRY(neigh)->vccs = (void *) 0xdeadbeef; 270 NEIGH2ENTRY(neigh)->vccs = (void *) NEIGHBOR_DEAD;
271} 271}
272 272
273static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 273static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
@@ -500,9 +500,11 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
500 } else { 500 } else {
501 unsigned int len = skb->len; 501 unsigned int len = skb->len;
502 502
503 skb_get(skb);
503 clip_push(vcc, skb); 504 clip_push(vcc, skb);
504 PRIV(skb->dev)->stats.rx_packets--; 505 PRIV(skb->dev)->stats.rx_packets--;
505 PRIV(skb->dev)->stats.rx_bytes -= len; 506 PRIV(skb->dev)->stats.rx_bytes -= len;
507 kfree_skb(skb);
506 } 508 }
507 return 0; 509 return 0;
508} 510}
@@ -929,12 +931,11 @@ static int arp_seq_open(struct inode *inode, struct file *file)
929 struct seq_file *seq; 931 struct seq_file *seq;
930 int rc = -EAGAIN; 932 int rc = -EAGAIN;
931 933
932 state = kmalloc(sizeof(*state), GFP_KERNEL); 934 state = kzalloc(sizeof(*state), GFP_KERNEL);
933 if (!state) { 935 if (!state) {
934 rc = -ENOMEM; 936 rc = -ENOMEM;
935 goto out_kfree; 937 goto out_kfree;
936 } 938 }
937 memset(state, 0, sizeof(*state));
938 state->ns.neigh_sub_iter = clip_seq_sub_iter; 939 state->ns.neigh_sub_iter = clip_seq_sub_iter;
939 940
940 rc = seq_open(file, &arp_seq_ops); 941 rc = seq_open(file, &arp_seq_ops);
@@ -962,7 +963,6 @@ static struct file_operations arp_seq_fops = {
962 963
963static int __init atm_clip_init(void) 964static int __init atm_clip_init(void)
964{ 965{
965 struct proc_dir_entry *p;
966 neigh_table_init_no_netlink(&clip_tbl); 966 neigh_table_init_no_netlink(&clip_tbl);
967 967
968 clip_tbl_hook = &clip_tbl; 968 clip_tbl_hook = &clip_tbl;
@@ -972,9 +972,15 @@ static int __init atm_clip_init(void)
972 972
973 setup_timer(&idle_timer, idle_timer_check, 0); 973 setup_timer(&idle_timer, idle_timer_check, 0);
974 974
975 p = create_proc_entry("arp", S_IRUGO, atm_proc_root); 975#ifdef CONFIG_PROC_FS
976 if (p) 976 {
977 p->proc_fops = &arp_seq_fops; 977 struct proc_dir_entry *p;
978
979 p = create_proc_entry("arp", S_IRUGO, atm_proc_root);
980 if (p)
981 p->proc_fops = &arp_seq_fops;
982 }
983#endif
978 984
979 return 0; 985 return 0;
980} 986}