aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose/rose_route.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-09-06 18:49:39 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-06 18:49:39 -0400
commitf75268cd6cbd24e6c70ff1390f4de5d0bb618539 (patch)
treeade569781c444bd7f0d648a38cab205d7624e286 /net/rose/rose_route.c
parentf2c383988d68c91a7d474b7cf26c0a2df49bbafe (diff)
[AX25]: Make ax2asc thread-proof
Ax2asc was still using a static buffer for all invocations which isn't exactly SMP-safe. Change ax2asc to take an additional result buffer as the argument. Change all callers to provide such a buffer. Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rose/rose_route.c')
-rw-r--r--net/rose/rose_route.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 4510cd7613ec..e556d92c0bc4 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -851,6 +851,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
851 unsigned char cause, diagnostic; 851 unsigned char cause, diagnostic;
852 struct net_device *dev; 852 struct net_device *dev;
853 int len, res = 0; 853 int len, res = 0;
854 char buf[11];
854 855
855#if 0 856#if 0
856 if (call_in_firewall(PF_ROSE, skb->dev, skb->data, NULL, &skb) != FW_ACCEPT) 857 if (call_in_firewall(PF_ROSE, skb->dev, skb->data, NULL, &skb) != FW_ACCEPT)
@@ -876,7 +877,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
876 877
877 if (rose_neigh == NULL) { 878 if (rose_neigh == NULL) {
878 printk("rose_route : unknown neighbour or device %s\n", 879 printk("rose_route : unknown neighbour or device %s\n",
879 ax2asc(&ax25->dest_addr)); 880 ax2asc(buf, &ax25->dest_addr));
880 goto out; 881 goto out;
881 } 882 }
882 883
@@ -1178,6 +1179,7 @@ static void rose_neigh_stop(struct seq_file *seq, void *v)
1178 1179
1179static int rose_neigh_show(struct seq_file *seq, void *v) 1180static int rose_neigh_show(struct seq_file *seq, void *v)
1180{ 1181{
1182 char buf[11];
1181 int i; 1183 int i;
1182 1184
1183 if (v == SEQ_START_TOKEN) 1185 if (v == SEQ_START_TOKEN)
@@ -1189,7 +1191,7 @@ static int rose_neigh_show(struct seq_file *seq, void *v)
1189 /* if (!rose_neigh->loopback) { */ 1191 /* if (!rose_neigh->loopback) { */
1190 seq_printf(seq, "%05d %-9s %-4s %3d %3d %3s %3s %3lu %3lu", 1192 seq_printf(seq, "%05d %-9s %-4s %3d %3d %3s %3s %3lu %3lu",
1191 rose_neigh->number, 1193 rose_neigh->number,
1192 (rose_neigh->loopback) ? "RSLOOP-0" : ax2asc(&rose_neigh->callsign), 1194 (rose_neigh->loopback) ? "RSLOOP-0" : ax2asc(buf, &rose_neigh->callsign),
1193 rose_neigh->dev ? rose_neigh->dev->name : "???", 1195 rose_neigh->dev ? rose_neigh->dev->name : "???",
1194 rose_neigh->count, 1196 rose_neigh->count,
1195 rose_neigh->use, 1197 rose_neigh->use,
@@ -1200,7 +1202,7 @@ static int rose_neigh_show(struct seq_file *seq, void *v)
1200 1202
1201 if (rose_neigh->digipeat != NULL) { 1203 if (rose_neigh->digipeat != NULL) {
1202 for (i = 0; i < rose_neigh->digipeat->ndigi; i++) 1204 for (i = 0; i < rose_neigh->digipeat->ndigi; i++)
1203 seq_printf(seq, " %s", ax2asc(&rose_neigh->digipeat->calls[i])); 1205 seq_printf(seq, " %s", ax2asc(buf, &rose_neigh->digipeat->calls[i]));
1204 } 1206 }
1205 1207
1206 seq_puts(seq, "\n"); 1208 seq_puts(seq, "\n");
@@ -1260,6 +1262,8 @@ static void rose_route_stop(struct seq_file *seq, void *v)
1260 1262
1261static int rose_route_show(struct seq_file *seq, void *v) 1263static int rose_route_show(struct seq_file *seq, void *v)
1262{ 1264{
1265 char buf[11];
1266
1263 if (v == SEQ_START_TOKEN) 1267 if (v == SEQ_START_TOKEN)
1264 seq_puts(seq, 1268 seq_puts(seq,
1265 "lci address callsign neigh <-> lci address callsign neigh\n"); 1269 "lci address callsign neigh <-> lci address callsign neigh\n");
@@ -1271,7 +1275,7 @@ static int rose_route_show(struct seq_file *seq, void *v)
1271 "%3.3X %-10s %-9s %05d ", 1275 "%3.3X %-10s %-9s %05d ",
1272 rose_route->lci1, 1276 rose_route->lci1,
1273 rose2asc(&rose_route->src_addr), 1277 rose2asc(&rose_route->src_addr),
1274 ax2asc(&rose_route->src_call), 1278 ax2asc(buf, &rose_route->src_call),
1275 rose_route->neigh1->number); 1279 rose_route->neigh1->number);
1276 else 1280 else
1277 seq_puts(seq, 1281 seq_puts(seq,
@@ -1282,7 +1286,7 @@ static int rose_route_show(struct seq_file *seq, void *v)
1282 "%3.3X %-10s %-9s %05d\n", 1286 "%3.3X %-10s %-9s %05d\n",
1283 rose_route->lci2, 1287 rose_route->lci2,
1284 rose2asc(&rose_route->dest_addr), 1288 rose2asc(&rose_route->dest_addr),
1285 ax2asc(&rose_route->dest_call), 1289 ax2asc(buf, &rose_route->dest_call),
1286 rose_route->neigh2->number); 1290 rose_route->neigh2->number);
1287 else 1291 else
1288 seq_puts(seq, 1292 seq_puts(seq,