ethernet: fix mac address increment error 28/37028/2
authorJieqiang Wang <jieqiang.wang@arm.com>
Sun, 14 Aug 2022 09:49:44 +0000 (17:49 +0800)
committerNeale Ranns <neale@graphiant.com>
Mon, 29 Aug 2022 23:55:08 +0000 (23:55 +0000)
commit186b2156c02c785b16a6d3cd02d3d327928a5397
treeaff5bebc481b56373440c14e809006be8dc4a4da
parentd2acfbc8f8beaaa544d70163da1622a72a863084
ethernet: fix mac address increment error

Using "ip neighbor <ip-addr> <mac-addr> static count <count>" to add
static ARP entries will output wrong mac addresses due to lack of
big/little endian conversion. Fix this error by converting mac address
from big endian to little endian before doing the self-increment.

Before patched:

vpp# ip neighbor rdma-0 198.18.1.1 01:aa:bb:cc:dd:e0 static count 5
vpp# show ip neighbor
    Time                       IP                    Flags      Ethernet              Interface
      4.4400               198.18.1.5                  S    05:aa:bb:cc:dd:e0  rdma-0
      4.4399               198.18.1.4                  S    04:aa:bb:cc:dd:e0  rdma-0
      4.4399               198.18.1.3                  S    03:aa:bb:cc:dd:e0  rdma-0
      4.4399               198.18.1.2                  S    02:aa:bb:cc:dd:e0  rdma-0
      4.4399               198.18.1.1                  S    01:aa:bb:cc:dd:e0  rdma-0

After patched:

vpp# ip neighbor rdma-0 198.18.1.1 01:aa:bb:cc:dd:e0 static count 5
vpp# show ip neighbor
    Time                       IP                    Flags      Ethernet              Interface
      4.4528               198.18.1.5                  S    01:aa:bb:cc:dd:e4  rdma-0
      4.4528               198.18.1.4                  S    01:aa:bb:cc:dd:e3  rdma-0
      4.4528               198.18.1.3                  S    01:aa:bb:cc:dd:e2  rdma-0
      4.4527               198.18.1.2                  S    01:aa:bb:cc:dd:e1  rdma-0
      4.4527               198.18.1.1                  S    01:aa:bb:cc:dd:e0  rdma-0

Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: Iec1e00e381e4aba96639f831e7e42e070be3f278
src/vnet/ethernet/mac_address.c