Add DATAPATH_ID to switch packaging, to enable persistent DPIDs.

This commit is contained in:
Ben Pfaff committed 2008-11-26 22:26:42 -08:00
1 parent e21567dc0d
commit 72ce961ebb
2 files changed
+25

No files matched your search

+15
View File
@@ -46,6 +46,7 @@ unset MGMT_VCONNS
unset COMMANDS
unset DAEMON_OPTS
unset CORE_LIMIT
unset DATAPATH_ID
default=/etc/default/openflow-switch
if [ -f $default ] ; then
. $default
@@ -222,6 +223,20 @@ case "$1" in
must_succeed "Adding $netdev to datapath" dpctl addif nl:0 $netdev
done
xx='[0-9abcdefABCDEF][0-9abcdefABCDEF]'
case $DATAPATH_ID in
'')
;;
$xx:$xx:$xx:$xx:$xx:$xx)
ifconfig of0 down
must_succeed "Setting of0 MAC address to $DATAPATH_ID" ifconfig of0 hw ether $DATAPATH_ID
ifconfig of0 up
;;
*)
echo "DATAPATH_ID is not a valid MAC address in the form XX:XX:XX:XX:XX:XX, ignoring" >&2
;;
esac
if test "$MODE" = in-band; then
if test "$SWITCH_IP" = dhcp; then
must_succeed "Temporarily disabling of0" ifconfig of0 down