aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25')
-rw-r--r--net/ax25/af_ax25.c33
-rw-r--r--net/ax25/ax25_dev.c1
-rw-r--r--net/ax25/ax25_ds_subr.c1
-rw-r--r--net/ax25/ax25_iface.c1
-rw-r--r--net/ax25/ax25_in.c1
-rw-r--r--net/ax25/ax25_ip.c1
-rw-r--r--net/ax25/ax25_out.c7
-rw-r--r--net/ax25/ax25_route.c1
-rw-r--r--net/ax25/ax25_subr.c1
-rw-r--r--net/ax25/ax25_uid.c26
-rw-r--r--net/ax25/sysctl_net_ax25.c39
11 files changed, 35 insertions, 77 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index f45460730371..65c5801261f9 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -25,6 +25,7 @@
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/sockios.h> 26#include <linux/sockios.h>
27#include <linux/net.h> 27#include <linux/net.h>
28#include <linux/slab.h>
28#include <net/ax25.h> 29#include <net/ax25.h>
29#include <linux/inet.h> 30#include <linux/inet.h>
30#include <linux/netdevice.h> 31#include <linux/netdevice.h>
@@ -369,6 +370,9 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
369 if (ax25_ctl.digi_count > AX25_MAX_DIGIS) 370 if (ax25_ctl.digi_count > AX25_MAX_DIGIS)
370 return -EINVAL; 371 return -EINVAL;
371 372
373 if (ax25_ctl.arg > ULONG_MAX / HZ && ax25_ctl.cmd != AX25_KILL)
374 return -EINVAL;
375
372 digi.ndigi = ax25_ctl.digi_count; 376 digi.ndigi = ax25_ctl.digi_count;
373 for (k = 0; k < digi.ndigi; k++) 377 for (k = 0; k < digi.ndigi; k++)
374 digi.calls[k] = ax25_ctl.digi_addr[k]; 378 digi.calls[k] = ax25_ctl.digi_addr[k];
@@ -418,14 +422,10 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
418 break; 422 break;
419 423
420 case AX25_T3: 424 case AX25_T3:
421 if (ax25_ctl.arg < 0)
422 goto einval_put;
423 ax25->t3 = ax25_ctl.arg * HZ; 425 ax25->t3 = ax25_ctl.arg * HZ;
424 break; 426 break;
425 427
426 case AX25_IDLE: 428 case AX25_IDLE:
427 if (ax25_ctl.arg < 0)
428 goto einval_put;
429 ax25->idle = ax25_ctl.arg * 60 * HZ; 429 ax25->idle = ax25_ctl.arg * 60 * HZ;
430 break; 430 break;
431 431
@@ -800,12 +800,13 @@ static struct proto ax25_proto = {
800 .obj_size = sizeof(struct sock), 800 .obj_size = sizeof(struct sock),
801}; 801};
802 802
803static int ax25_create(struct net *net, struct socket *sock, int protocol) 803static int ax25_create(struct net *net, struct socket *sock, int protocol,
804 int kern)
804{ 805{
805 struct sock *sk; 806 struct sock *sk;
806 ax25_cb *ax25; 807 ax25_cb *ax25;
807 808
808 if (net != &init_net) 809 if (!net_eq(net, &init_net))
809 return -EAFNOSUPPORT; 810 return -EAFNOSUPPORT;
810 811
811 switch (sock->type) { 812 switch (sock->type) {
@@ -1863,25 +1864,13 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1863static void *ax25_info_start(struct seq_file *seq, loff_t *pos) 1864static void *ax25_info_start(struct seq_file *seq, loff_t *pos)
1864 __acquires(ax25_list_lock) 1865 __acquires(ax25_list_lock)
1865{ 1866{
1866 struct ax25_cb *ax25;
1867 struct hlist_node *node;
1868 int i = 0;
1869
1870 spin_lock_bh(&ax25_list_lock); 1867 spin_lock_bh(&ax25_list_lock);
1871 ax25_for_each(ax25, node, &ax25_list) { 1868 return seq_hlist_start(&ax25_list, *pos);
1872 if (i == *pos)
1873 return ax25;
1874 ++i;
1875 }
1876 return NULL;
1877} 1869}
1878 1870
1879static void *ax25_info_next(struct seq_file *seq, void *v, loff_t *pos) 1871static void *ax25_info_next(struct seq_file *seq, void *v, loff_t *pos)
1880{ 1872{
1881 ++*pos; 1873 return seq_hlist_next(v, &ax25_list, pos);
1882
1883 return hlist_entry( ((struct ax25_cb *)v)->ax25_node.next,
1884 struct ax25_cb, ax25_node);
1885} 1874}
1886 1875
1887static void ax25_info_stop(struct seq_file *seq, void *v) 1876static void ax25_info_stop(struct seq_file *seq, void *v)
@@ -1892,7 +1881,7 @@ static void ax25_info_stop(struct seq_file *seq, void *v)
1892 1881
1893static int ax25_info_show(struct seq_file *seq, void *v) 1882static int ax25_info_show(struct seq_file *seq, void *v)
1894{ 1883{
1895 ax25_cb *ax25 = v; 1884 ax25_cb *ax25 = hlist_entry(v, struct ax25_cb, ax25_node);
1896 char buf[11]; 1885 char buf[11];
1897 int k; 1886 int k;
1898 1887
@@ -1961,7 +1950,7 @@ static const struct file_operations ax25_info_fops = {
1961 1950
1962#endif 1951#endif
1963 1952
1964static struct net_proto_family ax25_family_ops = { 1953static const struct net_proto_family ax25_family_ops = {
1965 .family = PF_AX25, 1954 .family = PF_AX25,
1966 .create = ax25_create, 1955 .create = ax25_create,
1967 .owner = THIS_MODULE, 1956 .owner = THIS_MODULE,
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index a7a0e0c9698b..c1cb982f6e86 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -9,6 +9,7 @@
9#include <linux/errno.h> 9#include <linux/errno.h>
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/slab.h>
12#include <linux/in.h> 13#include <linux/in.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/timer.h> 15#include <linux/timer.h>
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c
index b5e59787be2f..85816e612dc0 100644
--- a/net/ax25/ax25_ds_subr.c
+++ b/net/ax25/ax25_ds_subr.c
@@ -17,6 +17,7 @@
17#include <linux/sockios.h> 17#include <linux/sockios.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/net.h> 19#include <linux/net.h>
20#include <linux/gfp.h>
20#include <net/ax25.h> 21#include <net/ax25.h>
21#include <linux/inet.h> 22#include <linux/inet.h>
22#include <linux/netdevice.h> 23#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index 71338f112108..5a0dda8df492 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -17,6 +17,7 @@
17#include <linux/string.h> 17#include <linux/string.h>
18#include <linux/sockios.h> 18#include <linux/sockios.h>
19#include <linux/net.h> 19#include <linux/net.h>
20#include <linux/slab.h>
20#include <net/ax25.h> 21#include <net/ax25.h>
21#include <linux/inet.h> 22#include <linux/inet.h>
22#include <linux/netdevice.h> 23#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index de56d3983de0..9bb776541203 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -18,6 +18,7 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/sockios.h> 19#include <linux/sockios.h>
20#include <linux/net.h> 20#include <linux/net.h>
21#include <linux/slab.h>
21#include <net/ax25.h> 22#include <net/ax25.h>
22#include <linux/inet.h> 23#include <linux/inet.h>
23#include <linux/netdevice.h> 24#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index f047a57aa95c..cf0c47a26530 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -16,6 +16,7 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/sockios.h> 17#include <linux/sockios.h>
18#include <linux/net.h> 18#include <linux/net.h>
19#include <linux/slab.h>
19#include <net/ax25.h> 20#include <net/ax25.h>
20#include <linux/inet.h> 21#include <linux/inet.h>
21#include <linux/netdevice.h> 22#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index bf706f83a5c9..37507d806f65 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -19,6 +19,7 @@
19#include <linux/sockios.h> 19#include <linux/sockios.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/net.h> 21#include <linux/net.h>
22#include <linux/slab.h>
22#include <net/ax25.h> 23#include <net/ax25.h>
23#include <linux/inet.h> 24#include <linux/inet.h>
24#include <linux/netdevice.h> 25#include <linux/netdevice.h>
@@ -92,6 +93,12 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2
92#endif 93#endif
93 } 94 }
94 95
96 /*
97 * There is one ref for the state machine; a caller needs
98 * one more to put it back, just like with the existing one.
99 */
100 ax25_cb_hold(ax25);
101
95 ax25_cb_add(ax25); 102 ax25_cb_add(ax25);
96 103
97 ax25->state = AX25_STATE_1; 104 ax25->state = AX25_STATE_1;
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index c833ba4c45a5..7805945a5fd6 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -23,6 +23,7 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/sockios.h> 24#include <linux/sockios.h>
25#include <linux/net.h> 25#include <linux/net.h>
26#include <linux/slab.h>
26#include <net/ax25.h> 27#include <net/ax25.h>
27#include <linux/inet.h> 28#include <linux/inet.h>
28#include <linux/netdevice.h> 29#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index 034aa10a5198..c6715ee4ab8f 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -18,6 +18,7 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/sockios.h> 19#include <linux/sockios.h>
20#include <linux/net.h> 20#include <linux/net.h>
21#include <linux/slab.h>
21#include <net/ax25.h> 22#include <net/ax25.h>
22#include <linux/inet.h> 23#include <linux/inet.h>
23#include <linux/netdevice.h> 24#include <linux/netdevice.h>
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index 832bcf092a01..d349be9578f5 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -18,6 +18,7 @@
18#include <linux/sockios.h> 18#include <linux/sockios.h>
19#include <linux/net.h> 19#include <linux/net.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/slab.h>
21#include <net/ax25.h> 22#include <net/ax25.h>
22#include <linux/inet.h> 23#include <linux/inet.h>
23#include <linux/netdevice.h> 24#include <linux/netdevice.h>
@@ -146,31 +147,13 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
146static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) 147static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
147 __acquires(ax25_uid_lock) 148 __acquires(ax25_uid_lock)
148{ 149{
149 struct ax25_uid_assoc *pt;
150 struct hlist_node *node;
151 int i = 1;
152
153 read_lock(&ax25_uid_lock); 150 read_lock(&ax25_uid_lock);
154 151 return seq_hlist_start_head(&ax25_uid_list, *pos);
155 if (*pos == 0)
156 return SEQ_START_TOKEN;
157
158 ax25_uid_for_each(pt, node, &ax25_uid_list) {
159 if (i == *pos)
160 return pt;
161 ++i;
162 }
163 return NULL;
164} 152}
165 153
166static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) 154static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
167{ 155{
168 ++*pos; 156 return seq_hlist_next(v, &ax25_uid_list, pos);
169 if (v == SEQ_START_TOKEN)
170 return ax25_uid_list.first;
171 else
172 return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,
173 ax25_uid_assoc, uid_node);
174} 157}
175 158
176static void ax25_uid_seq_stop(struct seq_file *seq, void *v) 159static void ax25_uid_seq_stop(struct seq_file *seq, void *v)
@@ -186,8 +169,9 @@ static int ax25_uid_seq_show(struct seq_file *seq, void *v)
186 if (v == SEQ_START_TOKEN) 169 if (v == SEQ_START_TOKEN)
187 seq_printf(seq, "Policy: %d\n", ax25_uid_policy); 170 seq_printf(seq, "Policy: %d\n", ax25_uid_policy);
188 else { 171 else {
189 struct ax25_uid_assoc *pt = v; 172 struct ax25_uid_assoc *pt;
190 173
174 pt = hlist_entry(v, struct ax25_uid_assoc, uid_node);
191 seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(buf, &pt->call)); 175 seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(buf, &pt->call));
192 } 176 }
193 return 0; 177 return 0;
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 62ee3fb34732..ebe0ef3f1d83 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -7,6 +7,7 @@
7 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com) 7 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
8 */ 8 */
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/slab.h>
10#include <linux/sysctl.h> 11#include <linux/sysctl.h>
11#include <linux/spinlock.h> 12#include <linux/spinlock.h>
12#include <net/ax25.h> 13#include <net/ax25.h>
@@ -34,156 +35,128 @@ static ctl_table *ax25_table;
34static int ax25_table_size; 35static int ax25_table_size;
35 36
36static struct ctl_path ax25_path[] = { 37static struct ctl_path ax25_path[] = {
37 { .procname = "net", .ctl_name = CTL_NET, }, 38 { .procname = "net", },
38 { .procname = "ax25", .ctl_name = NET_AX25, }, 39 { .procname = "ax25", },
39 { } 40 { }
40}; 41};
41 42
42static const ctl_table ax25_param_table[] = { 43static const ctl_table ax25_param_table[] = {
43 { 44 {
44 .ctl_name = NET_AX25_IP_DEFAULT_MODE,
45 .procname = "ip_default_mode", 45 .procname = "ip_default_mode",
46 .maxlen = sizeof(int), 46 .maxlen = sizeof(int),
47 .mode = 0644, 47 .mode = 0644,
48 .proc_handler = proc_dointvec_minmax, 48 .proc_handler = proc_dointvec_minmax,
49 .strategy = sysctl_intvec,
50 .extra1 = &min_ipdefmode, 49 .extra1 = &min_ipdefmode,
51 .extra2 = &max_ipdefmode 50 .extra2 = &max_ipdefmode
52 }, 51 },
53 { 52 {
54 .ctl_name = NET_AX25_DEFAULT_MODE,
55 .procname = "ax25_default_mode", 53 .procname = "ax25_default_mode",
56 .maxlen = sizeof(int), 54 .maxlen = sizeof(int),
57 .mode = 0644, 55 .mode = 0644,
58 .proc_handler = proc_dointvec_minmax, 56 .proc_handler = proc_dointvec_minmax,
59 .strategy = sysctl_intvec,
60 .extra1 = &min_axdefmode, 57 .extra1 = &min_axdefmode,
61 .extra2 = &max_axdefmode 58 .extra2 = &max_axdefmode
62 }, 59 },
63 { 60 {
64 .ctl_name = NET_AX25_BACKOFF_TYPE,
65 .procname = "backoff_type", 61 .procname = "backoff_type",
66 .maxlen = sizeof(int), 62 .maxlen = sizeof(int),
67 .mode = 0644, 63 .mode = 0644,
68 .proc_handler = proc_dointvec_minmax, 64 .proc_handler = proc_dointvec_minmax,
69 .strategy = sysctl_intvec,
70 .extra1 = &min_backoff, 65 .extra1 = &min_backoff,
71 .extra2 = &max_backoff 66 .extra2 = &max_backoff
72 }, 67 },
73 { 68 {
74 .ctl_name = NET_AX25_CONNECT_MODE,
75 .procname = "connect_mode", 69 .procname = "connect_mode",
76 .maxlen = sizeof(int), 70 .maxlen = sizeof(int),
77 .mode = 0644, 71 .mode = 0644,
78 .proc_handler = proc_dointvec_minmax, 72 .proc_handler = proc_dointvec_minmax,
79 .strategy = sysctl_intvec,
80 .extra1 = &min_conmode, 73 .extra1 = &min_conmode,
81 .extra2 = &max_conmode 74 .extra2 = &max_conmode
82 }, 75 },
83 { 76 {
84 .ctl_name = NET_AX25_STANDARD_WINDOW,
85 .procname = "standard_window_size", 77 .procname = "standard_window_size",
86 .maxlen = sizeof(int), 78 .maxlen = sizeof(int),
87 .mode = 0644, 79 .mode = 0644,
88 .proc_handler = proc_dointvec_minmax, 80 .proc_handler = proc_dointvec_minmax,
89 .strategy = sysctl_intvec,
90 .extra1 = &min_window, 81 .extra1 = &min_window,
91 .extra2 = &max_window 82 .extra2 = &max_window
92 }, 83 },
93 { 84 {
94 .ctl_name = NET_AX25_EXTENDED_WINDOW,
95 .procname = "extended_window_size", 85 .procname = "extended_window_size",
96 .maxlen = sizeof(int), 86 .maxlen = sizeof(int),
97 .mode = 0644, 87 .mode = 0644,
98 .proc_handler = proc_dointvec_minmax, 88 .proc_handler = proc_dointvec_minmax,
99 .strategy = sysctl_intvec,
100 .extra1 = &min_ewindow, 89 .extra1 = &min_ewindow,
101 .extra2 = &max_ewindow 90 .extra2 = &max_ewindow
102 }, 91 },
103 { 92 {
104 .ctl_name = NET_AX25_T1_TIMEOUT,
105 .procname = "t1_timeout", 93 .procname = "t1_timeout",
106 .maxlen = sizeof(int), 94 .maxlen = sizeof(int),
107 .mode = 0644, 95 .mode = 0644,
108 .proc_handler = proc_dointvec_minmax, 96 .proc_handler = proc_dointvec_minmax,
109 .strategy = sysctl_intvec,
110 .extra1 = &min_t1, 97 .extra1 = &min_t1,
111 .extra2 = &max_t1 98 .extra2 = &max_t1
112 }, 99 },
113 { 100 {
114 .ctl_name = NET_AX25_T2_TIMEOUT,
115 .procname = "t2_timeout", 101 .procname = "t2_timeout",
116 .maxlen = sizeof(int), 102 .maxlen = sizeof(int),
117 .mode = 0644, 103 .mode = 0644,
118 .proc_handler = proc_dointvec_minmax, 104 .proc_handler = proc_dointvec_minmax,
119 .strategy = sysctl_intvec,
120 .extra1 = &min_t2, 105 .extra1 = &min_t2,
121 .extra2 = &max_t2 106 .extra2 = &max_t2
122 }, 107 },
123 { 108 {
124 .ctl_name = NET_AX25_T3_TIMEOUT,
125 .procname = "t3_timeout", 109 .procname = "t3_timeout",
126 .maxlen = sizeof(int), 110 .maxlen = sizeof(int),
127 .mode = 0644, 111 .mode = 0644,
128 .proc_handler = proc_dointvec_minmax, 112 .proc_handler = proc_dointvec_minmax,
129 .strategy = sysctl_intvec,
130 .extra1 = &min_t3, 113 .extra1 = &min_t3,
131 .extra2 = &max_t3 114 .extra2 = &max_t3
132 }, 115 },
133 { 116 {
134 .ctl_name = NET_AX25_IDLE_TIMEOUT,
135 .procname = "idle_timeout", 117 .procname = "idle_timeout",
136 .maxlen = sizeof(int), 118 .maxlen = sizeof(int),
137 .mode = 0644, 119 .mode = 0644,
138 .proc_handler = proc_dointvec_minmax, 120 .proc_handler = proc_dointvec_minmax,
139 .strategy = sysctl_intvec,
140 .extra1 = &min_idle, 121 .extra1 = &min_idle,
141 .extra2 = &max_idle 122 .extra2 = &max_idle
142 }, 123 },
143 { 124 {
144 .ctl_name = NET_AX25_N2,
145 .procname = "maximum_retry_count", 125 .procname = "maximum_retry_count",
146 .maxlen = sizeof(int), 126 .maxlen = sizeof(int),
147 .mode = 0644, 127 .mode = 0644,
148 .proc_handler = proc_dointvec_minmax, 128 .proc_handler = proc_dointvec_minmax,
149 .strategy = sysctl_intvec,
150 .extra1 = &min_n2, 129 .extra1 = &min_n2,
151 .extra2 = &max_n2 130 .extra2 = &max_n2
152 }, 131 },
153 { 132 {
154 .ctl_name = NET_AX25_PACLEN,
155 .procname = "maximum_packet_length", 133 .procname = "maximum_packet_length",
156 .maxlen = sizeof(int), 134 .maxlen = sizeof(int),
157 .mode = 0644, 135 .mode = 0644,
158 .proc_handler = proc_dointvec_minmax, 136 .proc_handler = proc_dointvec_minmax,
159 .strategy = sysctl_intvec,
160 .extra1 = &min_paclen, 137 .extra1 = &min_paclen,
161 .extra2 = &max_paclen 138 .extra2 = &max_paclen
162 }, 139 },
163 { 140 {
164 .ctl_name = NET_AX25_PROTOCOL,
165 .procname = "protocol", 141 .procname = "protocol",
166 .maxlen = sizeof(int), 142 .maxlen = sizeof(int),
167 .mode = 0644, 143 .mode = 0644,
168 .proc_handler = proc_dointvec_minmax, 144 .proc_handler = proc_dointvec_minmax,
169 .strategy = sysctl_intvec,
170 .extra1 = &min_proto, 145 .extra1 = &min_proto,
171 .extra2 = &max_proto 146 .extra2 = &max_proto
172 }, 147 },
173#ifdef CONFIG_AX25_DAMA_SLAVE 148#ifdef CONFIG_AX25_DAMA_SLAVE
174 { 149 {
175 .ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT,
176 .procname = "dama_slave_timeout", 150 .procname = "dama_slave_timeout",
177 .maxlen = sizeof(int), 151 .maxlen = sizeof(int),
178 .mode = 0644, 152 .mode = 0644,
179 .proc_handler = proc_dointvec_minmax, 153 .proc_handler = proc_dointvec_minmax,
180 .strategy = sysctl_intvec,
181 .extra1 = &min_ds_timeout, 154 .extra1 = &min_ds_timeout,
182 .extra2 = &max_ds_timeout 155 .extra2 = &max_ds_timeout
183 }, 156 },
184#endif 157#endif
185 158
186 { .ctl_name = 0 } /* that's all, folks! */ 159 { } /* that's all, folks! */
187}; 160};
188 161
189void ax25_register_sysctl(void) 162void ax25_register_sysctl(void)
@@ -212,11 +185,9 @@ void ax25_register_sysctl(void)
212 return; 185 return;
213 } 186 }
214 ax25_table[n].child = ax25_dev->systable = child; 187 ax25_table[n].child = ax25_dev->systable = child;
215 ax25_table[n].ctl_name = n + 1;
216 ax25_table[n].procname = ax25_dev->dev->name; 188 ax25_table[n].procname = ax25_dev->dev->name;
217 ax25_table[n].mode = 0555; 189 ax25_table[n].mode = 0555;
218 190
219 child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */
220 191
221 for (k = 0; k < AX25_MAX_VALUES; k++) 192 for (k = 0; k < AX25_MAX_VALUES; k++)
222 child[k].data = &ax25_dev->values[k]; 193 child[k].data = &ax25_dev->values[k];
@@ -233,7 +204,7 @@ void ax25_unregister_sysctl(void)
233 ctl_table *p; 204 ctl_table *p;
234 unregister_sysctl_table(ax25_table_header); 205 unregister_sysctl_table(ax25_table_header);
235 206
236 for (p = ax25_table; p->ctl_name; p++) 207 for (p = ax25_table; p->procname; p++)
237 kfree(p->child); 208 kfree(p->child);
238 kfree(ax25_table); 209 kfree(ax25_table);
239} 210}