Skip to content

Commit

Permalink
Use MAC from EEPROM for Interfaces (#329)
Browse files Browse the repository at this point in the history
* Use MAC from EEPROM for Interfaces

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>

* Use platform MAC from DB

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
  • Loading branch information
andriymoroz-mlnx authored and lguohan committed Oct 13, 2018
1 parent 17fd36e commit 82fcc31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ config_syncd_mlnx()
[ -e /dev/sxdevs/sxcdev ] || ( mkdir -p /dev/sxdevs && mknod /dev/sxdevs/sxcdev c 231 193 )

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

0 comments on commit 82fcc31

Please sign in to comment.