aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose/af_rose.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose/af_rose.c')
-rw-r--r--net/rose/af_rose.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 6bd8e93869ed..e5f478ca3d61 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -92,23 +92,21 @@ static void rose_set_lockdep_key(struct net_device *dev)
92/* 92/*
93 * Convert a ROSE address into text. 93 * Convert a ROSE address into text.
94 */ 94 */
95const char *rose2asc(const rose_address *addr) 95char *rose2asc(char *buf, const rose_address *addr)
96{ 96{
97 static char buffer[11];
98
99 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 && 97 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
100 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 && 98 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
101 addr->rose_addr[4] == 0x00) { 99 addr->rose_addr[4] == 0x00) {
102 strcpy(buffer, "*"); 100 strcpy(buf, "*");
103 } else { 101 } else {
104 sprintf(buffer, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, 102 sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF,
105 addr->rose_addr[1] & 0xFF, 103 addr->rose_addr[1] & 0xFF,
106 addr->rose_addr[2] & 0xFF, 104 addr->rose_addr[2] & 0xFF,
107 addr->rose_addr[3] & 0xFF, 105 addr->rose_addr[3] & 0xFF,
108 addr->rose_addr[4] & 0xFF); 106 addr->rose_addr[4] & 0xFF);
109 } 107 }
110 108
111 return buffer; 109 return buf;
112} 110}
113 111
114/* 112/*
@@ -956,6 +954,7 @@ static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
956 struct rose_sock *rose = rose_sk(sk); 954 struct rose_sock *rose = rose_sk(sk);
957 int n; 955 int n;
958 956
957 memset(srose, 0, sizeof(*srose));
959 if (peer != 0) { 958 if (peer != 0) {
960 if (sk->sk_state != TCP_ESTABLISHED) 959 if (sk->sk_state != TCP_ESTABLISHED)
961 return -ENOTCONN; 960 return -ENOTCONN;
@@ -1437,7 +1436,7 @@ static void rose_info_stop(struct seq_file *seq, void *v)
1437 1436
1438static int rose_info_show(struct seq_file *seq, void *v) 1437static int rose_info_show(struct seq_file *seq, void *v)
1439{ 1438{
1440 char buf[11]; 1439 char buf[11], rsbuf[11];
1441 1440
1442 if (v == SEQ_START_TOKEN) 1441 if (v == SEQ_START_TOKEN)
1443 seq_puts(seq, 1442 seq_puts(seq,
@@ -1455,8 +1454,8 @@ static int rose_info_show(struct seq_file *seq, void *v)
1455 devname = dev->name; 1454 devname = dev->name;
1456 1455
1457 seq_printf(seq, "%-10s %-9s ", 1456 seq_printf(seq, "%-10s %-9s ",
1458 rose2asc(&rose->dest_addr), 1457 rose2asc(rsbuf, &rose->dest_addr),
1459 ax2asc(buf, &rose->dest_call)); 1458 ax2asc(buf, &rose->dest_call));
1460 1459
1461 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0) 1460 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
1462 callsign = "??????-?"; 1461 callsign = "??????-?";
@@ -1465,7 +1464,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
1465 1464
1466 seq_printf(seq, 1465 seq_printf(seq,
1467 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n", 1466 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n",
1468 rose2asc(&rose->source_addr), 1467 rose2asc(rsbuf, &rose->source_addr),
1469 callsign, 1468 callsign,
1470 devname, 1469 devname,
1471 rose->lci & 0x0FFF, 1470 rose->lci & 0x0FFF,