• Ralf Baechle's avatar
    Fix conversion of some ROSE addresses. · b4f51826
    Ralf Baechle authored
    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: 's avatarRalf Baechle <ralf@linux-mips.org>
    b4f51826
Name
Last commit
Last update
RPM Loading commit data...
include Loading commit data...
lib Loading commit data...
man Loading commit data...
po Loading commit data...
.cvsignore Loading commit data...
.gitignore Loading commit data...
ABOUT-NLS Loading commit data...
COPYING Loading commit data...
INSTALLING Loading commit data...
Makefile Loading commit data...
README Loading commit data...
THANKS Loading commit data...
TODO Loading commit data...
arp.c Loading commit data...
config.in Loading commit data...
configure.sh Loading commit data...
hostname.c Loading commit data...
ifconfig.c Loading commit data...
intl.h Loading commit data...
ipmaddr.c Loading commit data...
iptunnel.c Loading commit data...
mii-tool.c Loading commit data...
nameif.c Loading commit data...
netstat.c Loading commit data...
plipconfig.c Loading commit data...
rarp.c Loading commit data...
route.c Loading commit data...
slattach.c Loading commit data...
statistics.c Loading commit data...