Skip to content

Commit df529ef

Browse files
authored
[baseimage]: fix mac address calculation on mellanox and centec platform (#1166)
1 parent eef4a89 commit df529ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/image_config/platform/rc.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then
8484
SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
8585

8686
# Align last byte of MAC if necessary
87-
if [ "$SONIC_ASIC_TYPE" == "mellanox" -o "$SONIC_ASIC_TYPE" == "centec" ]; then
87+
if [ "$SONIC_ASIC_TYPE" = "mellanox" ] || [ "$SONIC_ASIC_TYPE" = "centec" ]; then
8888
last_byte=$(python -c "print '$SYSTEM_MAC_ADDRESS'[-2:]")
8989
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
9090
SYSTEM_MAC_ADDRESS=$(python -c "print '$SYSTEM_MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC

0 commit comments

Comments
 (0)