Fix conversion of some ROSE addresses.
The ROSE code is using %02x for conversion of the BCD encoded ROSE
address to ASCII resulting in
# ifconfig rose0 hw rose 0123456789
# ifconfig rose0
rose0: flags=128<NOARP> mtu 249
rose 01234567ff txqueuelen 1 (AMPR ROSE)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
This is due to the stdio %02x conversion doesn't as the code seems o
expect truncate the converted output to two rightmost digits as illustrated
by this little test case:
#include <stdio.h>
static char array[] = { 0x88 };
int main(int argc, char *argv[])
{
printf("%02hx\n", array[0]);
return 0;
}
Fixed by replacing the use of %02x with %02hhx.
Signed-off-by:
Ralf Baechle <ralf@linux-mips.org>
Showing
Please register or sign in to comment