CORD-2063 Correctly update interface MAC when network config is updated

Note: this is only a temporary fix that still doesn't offer full dynamic interface config capability

Change-Id: Ieb2a9316821d3e8a3ad9257b2980e14ddbafec4d
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 79bd8d3..9d4cf04 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -1398,6 +1398,14 @@
         }
     }
 
+    private void createOrUpdateDeviceConfiguration() {
+        if (deviceConfiguration == null) {
+            deviceConfiguration = new DeviceConfiguration(this);
+        } else {
+            deviceConfiguration.updateConfig();
+        }
+    }
+
     /**
      * Registers the given connect point with the NRS, this is necessary
      * to receive the NDP and ARP packets from the NRS.
@@ -1429,11 +1437,7 @@
          * Reads network config and initializes related data structure accordingly.
          */
         public void configureNetwork() {
-            if (deviceConfiguration == null) {
-                deviceConfiguration = new DeviceConfiguration(srManager);
-            } else {
-                deviceConfiguration.updateConfig();
-            }
+            createOrUpdateDeviceConfiguration();
 
             arpHandler = new ArpHandler(srManager);
             icmpHandler = new IcmpHandler(srManager);
@@ -1466,6 +1470,7 @@
                         break;
                     case CONFIG_UPDATED:
                         log.info("Segment Routing Config updated for {}", event.subject());
+                        createOrUpdateDeviceConfiguration();
                         // TODO support dynamic configuration
                         break;
                     default:
@@ -1479,6 +1484,7 @@
                         break;
                     case CONFIG_UPDATED:
                         log.info("Interface Config updated for {}", event.subject());
+                        createOrUpdateDeviceConfiguration();
                         // TODO support dynamic configuration
                         break;
                     default: