rib: Update to properly handle optional ExpirationPeriod in RibRegister command
Change-Id: I9f18988f295a993e53dc03547f2f20967431dc10
Refs: #1772
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index c8d6111..d9c88e2 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -227,7 +227,8 @@
faceEntry.cost = parameters.getCost();
faceEntry.flags = parameters.getFlags();
- if (parameters.getExpirationPeriod() != time::milliseconds::max())
+ if (parameters.hasExpirationPeriod() &&
+ parameters.getExpirationPeriod() != time::milliseconds::max())
{
faceEntry.expires = time::steady_clock::now() + parameters.getExpirationPeriod();