Project

General

Profile

Bug #2535 » patch.diff

Patch file for ndn-global-routing-helper.cpp - Christian Kreuzberger, 02/18/2015 05:37 AM

View differences:

helper/ndn-global-routing-helper.cpp
315 315
    int faceNumber = 0;
316 316
    std::vector<uint16_t> originalMetric(uint32_t(l3->getForwarder()->getFaceTable().size()));
317 317
    for (auto& i : l3->getForwarder()->getFaceTable()) {
318
      faceNumber++;
319 318
      shared_ptr<Face> nfdFace = std::dynamic_pointer_cast<Face>(i);
320 319
      originalMetric[uint32_t(faceNumber)] = nfdFace->getMetric();
321 320
      nfdFace->setMetric(std::numeric_limits<uint16_t>::max() - 1);
321

  
322
      faceNumber++;
322 323
      // value std::numeric_limits<uint16_t>::max () MUST NOT be used (reserved)
323 324
    }
324 325

  
......
332 333
      }
333 334

  
334 335
      // enabling only faceId
335
      face->setMetric(originalMetric[uint32_t(faceNumber)]);
336
      face->setMetric(originalMetric[uint32_t(faceNumber)-1]);
336 337

  
337 338
      boost::DistancesMap distances;
338 339

  
......
381 382
    // recover original interface statuses
382 383
    faceNumber = 0;
383 384
    for (auto& i : l3->getForwarder()->getFaceTable()) {
384
      faceNumber++;
385 385
      shared_ptr<Face> face = std::dynamic_pointer_cast<Face>(i);
386 386
      face->setMetric(originalMetric[faceNumber]);
387
      faceNumber++;
387 388
    }
388 389
  }
389 390
}
(1-1/3)