aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ax25.h2
-rw-r--r--net/ax25/ax25_addr.c27
-rw-r--r--net/rose/rose_subr.c4
3 files changed, 15 insertions, 18 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 364b046e9f47..227d3378decd 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -258,7 +258,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
258/* ax25_addr.c */ 258/* ax25_addr.c */
259extern ax25_address null_ax25_address; 259extern ax25_address null_ax25_address;
260extern char *ax2asc(char *buf, ax25_address *); 260extern char *ax2asc(char *buf, ax25_address *);
261extern ax25_address *asc2ax(char *); 261extern void asc2ax(ax25_address *addr, char *callsign);
262extern int ax25cmp(ax25_address *, ax25_address *); 262extern int ax25cmp(ax25_address *, ax25_address *);
263extern int ax25digicmp(ax25_digi *, ax25_digi *); 263extern int ax25digicmp(ax25_digi *, ax25_digi *);
264extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); 264extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *);
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index dca179daf415..0164a155b8c4 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -67,37 +67,34 @@ char *ax2asc(char *buf, ax25_address *a)
67/* 67/*
68 * ascii -> ax25 conversion 68 * ascii -> ax25 conversion
69 */ 69 */
70ax25_address *asc2ax(char *callsign) 70void asc2ax(ax25_address *addr, char *callsign)
71{ 71{
72 static ax25_address addr;
73 char *s; 72 char *s;
74 int n; 73 int n;
75 74
76 for (s = callsign, n = 0; n < 6; n++) { 75 for (s = callsign, n = 0; n < 6; n++) {
77 if (*s != '\0' && *s != '-') 76 if (*s != '\0' && *s != '-')
78 addr.ax25_call[n] = *s++; 77 addr->ax25_call[n] = *s++;
79 else 78 else
80 addr.ax25_call[n] = ' '; 79 addr->ax25_call[n] = ' ';
81 addr.ax25_call[n] <<= 1; 80 addr->ax25_call[n] <<= 1;
82 addr.ax25_call[n] &= 0xFE; 81 addr->ax25_call[n] &= 0xFE;
83 } 82 }
84 83
85 if (*s++ == '\0') { 84 if (*s++ == '\0') {
86 addr.ax25_call[6] = 0x00; 85 addr->ax25_call[6] = 0x00;
87 return &addr; 86 return;
88 } 87 }
89 88
90 addr.ax25_call[6] = *s++ - '0'; 89 addr->ax25_call[6] = *s++ - '0';
91 90
92 if (*s != '\0') { 91 if (*s != '\0') {
93 addr.ax25_call[6] *= 10; 92 addr->ax25_call[6] *= 10;
94 addr.ax25_call[6] += *s++ - '0'; 93 addr->ax25_call[6] += *s++ - '0';
95 } 94 }
96 95
97 addr.ax25_call[6] <<= 1; 96 addr->ax25_call[6] <<= 1;
98 addr.ax25_call[6] &= 0x1E; 97 addr->ax25_call[6] &= 0x1E;
99
100 return &addr;
101} 98}
102 99
103/* 100/*
diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c
index 02891ce2db37..36a77944622b 100644
--- a/net/rose/rose_subr.c
+++ b/net/rose/rose_subr.c
@@ -337,13 +337,13 @@ static int rose_parse_ccitt(unsigned char *p, struct rose_facilities_struct *fac
337 memcpy(&facilities->source_addr, p + 7, ROSE_ADDR_LEN); 337 memcpy(&facilities->source_addr, p + 7, ROSE_ADDR_LEN);
338 memcpy(callsign, p + 12, l - 10); 338 memcpy(callsign, p + 12, l - 10);
339 callsign[l - 10] = '\0'; 339 callsign[l - 10] = '\0';
340 facilities->source_call = *asc2ax(callsign); 340 asc2ax(&facilities->source_call, callsign);
341 } 341 }
342 if (*p == FAC_CCITT_SRC_NSAP) { 342 if (*p == FAC_CCITT_SRC_NSAP) {
343 memcpy(&facilities->dest_addr, p + 7, ROSE_ADDR_LEN); 343 memcpy(&facilities->dest_addr, p + 7, ROSE_ADDR_LEN);
344 memcpy(callsign, p + 12, l - 10); 344 memcpy(callsign, p + 12, l - 10);
345 callsign[l - 10] = '\0'; 345 callsign[l - 10] = '\0';
346 facilities->dest_call = *asc2ax(callsign); 346 asc2ax(&facilities->dest_call, callsign);
347 } 347 }
348 p += l + 2; 348 p += l + 2;
349 n += l + 2; 349 n += l + 2;