From c2df1bc84792c6a31923fcb6486e88373656f7d1 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Sun, 26 Jan 2014 14:10:35 -0800 Subject: [PATCH] Self assign controller MAC when cannot retrieve one from host - When Switch Manager is not able to retrieve the list of the host network interfaces, self assign a custom MAC address. This is a quick fix for Hydrogen release. User can still overwrite the custom MAC with the one of his choice via switchmanager REST API Change-Id: I7a76107fc970e8dead649ac9e8703533921c8d30 Signed-off-by: Alessandro Boch --- .../controller/switchmanager/internal/SwitchManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java index 674da37afb..d8e6a7412f 100644 --- a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java +++ b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java @@ -1436,7 +1436,10 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa if (macAddress == null) { log.warn("Failed to acquire controller MAC: No physical interface found"); // This happens when running controller on windows VM, for example - // Try parsing the OS command output + // TODO: Try parsing the OS command output + // For now provide a quick fix for the release + macAddress = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x0c, (byte) 0x60, (byte) 0x0D, (byte) 0x10 }; + log.debug("Assigning custom MAC address to controller"); } return macAddress; } -- 2.36.6