https://github.com/torvalds/linux
Revision 1c5c12ee308aacf635c8819cd4baa3bd58f8a8b7 authored by Tao Ren on 24 April 2019, 01:43:32 UTC, committed by David S. Miller on 24 April 2019, 04:15:15 UTC
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: cb10c7c0dfd9 ("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>
1 parent ffbf987
Raw File
Tip revision: 1c5c12ee308aacf635c8819cd4baa3bd58f8a8b7 authored by Tao Ren on 24 April 2019, 01:43:32 UTC
net/ncsi: handle overflow when incrementing mac address
Tip revision: 1c5c12e
check-atomics.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Check if atomic headers are up-to-date

ATOMICDIR=$(dirname $0)
ATOMICTBL=${ATOMICDIR}/atomics.tbl
LINUXDIR=${ATOMICDIR}/../..

echo '' | sha1sum - > /dev/null 2>&1
if [ $? -ne 0 ]; then
	printf "sha1sum not available, skipping atomic header checks.\n"
	exit 0
fi

cat <<EOF |
asm-generic/atomic-instrumented.h
asm-generic/atomic-long.h
linux/atomic-fallback.h
EOF
while read header; do
	OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
	OLDSUM="${OLDSUM#// }"

	NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)"
	NEWSUM="${NEWSUM%% *}"

	if [ "${OLDSUM}" != "${NEWSUM}" ]; then
		printf "warning: generated include/${header} has been modified.\n"
	fi
done

exit 0
back to top