Skip to content

Commit 9846397

Browse files
andriymoroz-mlnxlguohan
authored andcommitted
Use MAC from EEPROM for Interfaces (sonic-net#329)
* Use MAC from EEPROM for Interfaces Signed-off-by: Andriy Moroz <[email protected]> * Use platform MAC from DB Signed-off-by: Andriy Moroz <[email protected]>
1 parent 5fee797 commit 9846397

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

syncd/scripts/syncd_init_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ config_syncd_mlnx()
5454
[ -e /dev/sxdevs/sxcdev ] || ( mkdir -p /dev/sxdevs && mknod /dev/sxdevs/sxcdev c 231 193 )
5555

5656
# Read MAC address and align the last 6 bits.
57-
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
57+
MAC_ADDRESS=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.mac)
5858
last_byte=$(python -c "print '$MAC_ADDRESS'[-2:]")
5959
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
6060
ALIGNED_MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC

0 commit comments

Comments
 (0)