Commit a0f17913 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace: rtu_stat: fix output format

Output for the mask parameter was wrong if high bits are zero.
This is not usually noticed as by default the mask is 0xffffffff but
in a deployed system I got this output, with spaces in the MASK column:

   RTU VLAN Table Dump:

     VID    FID       MASK       DROP    PRIO    PRIO_OVERRIDE
   -----------------------------------------------------------
      0      0      0x   7ffff    NO      --         NO
     30     31      0x   7fffe    NO      --         NO
     31     31      0x   40001    NO      --         NO
    102    102      0x   7ffff    NO      --         NO

Now I get:

     VID    FID       MASK       DROP    PRIO    PRIO_OVERRIDE
   -----------------------------------------------------------
      0      0      0x0007ffff    NO      --         NO
     30     31      0x0007fffe    NO      --         NO
     31     31      0x00040001    NO      --         NO
    102    102      0x0007ffff    NO      --         NO
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ae852163
Pipeline #509 passed with stage
in 99 minutes and 30 seconds
......@@ -1006,7 +1006,7 @@ int main(int argc, char **argv)
&& (vlan_tab_local[i].port_mask == 0x0))
continue;
printf("%4d %4d 0x%8x ", i, vlan_tab_local[i].fid,
printf("%4d %4d 0x%08x ", i, vlan_tab_local[i].fid,
vlan_tab_local[i].port_mask);
if (vlan_tab_local[i].drop == 0)
printf("NO ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment