[AX.25]: Make asc2ax() thread-proof
Asc2ax was still using a static buffer for all invocations which isn't exactly SMP-safe. Change asc2ax to take an additional result buffer as the argument. Change all callers to provide such a buffer. This one only really is a fix for ROSE and as per recent discussions there's still much more to fix in ROSE ... Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3a93481589
commit
baed16a7ff
@ -337,13 +337,13 @@ static int rose_parse_ccitt(unsigned char *p, struct rose_facilities_struct *fac
|
||||
memcpy(&facilities->source_addr, p + 7, ROSE_ADDR_LEN);
|
||||
memcpy(callsign, p + 12, l - 10);
|
||||
callsign[l - 10] = '\0';
|
||||
facilities->source_call = *asc2ax(callsign);
|
||||
asc2ax(&facilities->source_call, callsign);
|
||||
}
|
||||
if (*p == FAC_CCITT_SRC_NSAP) {
|
||||
memcpy(&facilities->dest_addr, p + 7, ROSE_ADDR_LEN);
|
||||
memcpy(callsign, p + 12, l - 10);
|
||||
callsign[l - 10] = '\0';
|
||||
facilities->dest_call = *asc2ax(callsign);
|
||||
asc2ax(&facilities->dest_call, callsign);
|
||||
}
|
||||
p += l + 2;
|
||||
n += l + 2;
|
||||
|
Reference in New Issue
Block a user