Committed by
Gerrit Code Review
Minor BgpRouter tweaks to make deactivating and reactivating easier:
* Push filters and default flows on activate if switch is already connected * Don't try and push filters for interfaces on other switches Change-Id: Idf1582c168439aa06d8efa0ab4b7352e96ef3712
Showing
1 changed file
with
14 additions
and
0 deletions
| ... | @@ -160,6 +160,15 @@ public class BgpRouter { | ... | @@ -160,6 +160,15 @@ public class BgpRouter { |
| 160 | connectivityManager.start(); | 160 | connectivityManager.start(); |
| 161 | icmpHandler.start(); | 161 | icmpHandler.start(); |
| 162 | 162 | ||
| 163 | + // Initialize devices now if they are already connected | ||
| 164 | + if (deviceService.isAvailable(deviceId)) { | ||
| 165 | + processIntfFilters(true, configService.getInterfaces()); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + if (deviceService.isAvailable(ctrlDeviceId)) { | ||
| 169 | + connectivityManager.notifySwitchAvailable(); | ||
| 170 | + } | ||
| 171 | + | ||
| 163 | log.info("BgpRouter started"); | 172 | log.info("BgpRouter started"); |
| 164 | } | 173 | } |
| 165 | 174 | ||
| ... | @@ -352,6 +361,11 @@ public class BgpRouter { | ... | @@ -352,6 +361,11 @@ public class BgpRouter { |
| 352 | private void processIntfFilters(boolean install, Set<Interface> intfs) { | 361 | private void processIntfFilters(boolean install, Set<Interface> intfs) { |
| 353 | log.info("Processing {} router interfaces", intfs.size()); | 362 | log.info("Processing {} router interfaces", intfs.size()); |
| 354 | for (Interface intf : intfs) { | 363 | for (Interface intf : intfs) { |
| 364 | + if (!intf.connectPoint().deviceId().equals(deviceId)) { | ||
| 365 | + // Ignore interfaces if they are not on the router switch | ||
| 366 | + continue; | ||
| 367 | + } | ||
| 368 | + | ||
| 355 | FilteringObjective.Builder fob = DefaultFilteringObjective.builder(); | 369 | FilteringObjective.Builder fob = DefaultFilteringObjective.builder(); |
| 356 | fob.withKey(Criteria.matchInPort(intf.connectPoint().port())) | 370 | fob.withKey(Criteria.matchInPort(intf.connectPoint().port())) |
| 357 | .addCondition(Criteria.matchEthDst(intf.mac())) | 371 | .addCondition(Criteria.matchEthDst(intf.mac())) | ... | ... |
-
Please register or login to post a comment