]> git.baikalelectronics.ru Git - kernel.git/commit
net/ncsi: handle overflow when incrementing mac address
authorTao Ren <taoren@fb.com>
Wed, 24 Apr 2019 01:43:32 +0000 (01:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2019 04:15:15 +0000 (21:15 -0700)
commit637b79b8c1d3a177dbf6aed006882ed94587eaa0
tree1c1ca7d6585c26d35d0e5f06288c9337a4052243
parent877d12f923e47daec053e9cb0397e07d4131241a
net/ncsi: handle overflow when incrementing mac address

Previously BMC's MAC address is calculated by simply adding 1 to the
last byte of network controller's MAC address, and it produces incorrect
result when network controller's MAC address ends with 0xFF.

The problem can be fixed by calling eth_addr_inc() function to increment
MAC address; besides, the MAC address is also validated before assigning
to BMC.

Fixes: 7afc4a939316 ("net/ncsi: Add NCSI Broadcom OEM command")
Signed-off-by: Tao Ren <taoren@fb.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/etherdevice.h
net/ncsi/ncsi-rsp.c