Skip to content

Commit

Permalink
fix for LCF caching
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Mar 23, 2019
1 parent 588dbec commit 3f00834
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions RasTbl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5954,6 +5954,7 @@ PreliminaryCall * PreliminaryCallTable::Find(const H225_CallIdentifier & id) con
CallLoopTable::CallLoopTable() : Singleton<CallLoopTable>("CallLoopTable")
{
m_expireTime = GkConfig()->GetInteger("RasSrv::LRQFeatures", "LoopDetectionExpireTime", 60);
m_reprocessLCFs = GkConfig()->GetInteger("RasSrv::LRQFeatures", "LoopDetectionReprocessLCFs", false);
}

CallLoopTable::~CallLoopTable()
Expand All @@ -5980,6 +5981,16 @@ CallLoopTable::LoopResult CallLoopTable::IsLoop(const H225_LocationRequest & lrq
return NoLoop;
}
if ((*iter).second.m_cachedLCF) {
if (m_reprocessLCFs) {
// reprocess all LCFs if switch is set
return NoLoop;
}
if (AsDotString((*iter).second.m_cachedLCF->m_rasAddress, false) == from
|| AsDotString((*iter).second.m_cachedLCF->m_callSignalAddress, false) == from) {
// don't use a cached LCF if it points back to the sender
// must be a cached version for sender further down the stream
return NoLoop;
}
cachedLCF = *(*iter).second.m_cachedLCF;
return CachedLCF;
}
Expand Down
1 change: 1 addition & 0 deletions RasTbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,7 @@ class CallLoopTable : public Singleton<CallLoopTable>
mutable PReadWriteMutex tableLock;
std::map<PString, RequestData> m_knownCalls;
unsigned m_expireTime;
bool m_reprocessLCFs;
};

#endif // RASTBL_H
5 changes: 5 additions & 0 deletions docs/manual/neighbors.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ Default: <tt>60</tt><newline>
<p>
Time duration in seconds how long to store data about calls GnuGk has seen.

<item><tt/LoopDetectionReprocessLCFs=1/<newline>
Default: <tt>0</tt><newline>
<p>
Don't cache any LCFs in the loop detection. Use if cached LCFs with incorrect data (for another endpoint) break the routing.

</itemize>


Expand Down
1 change: 1 addition & 0 deletions gk.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ const char * KnownConfigEntries[][2] = {
{ "RasSrv::LRQFeatures", "ForwardResponse" },
{ "RasSrv::LRQFeatures", "LoopDetection" },
{ "RasSrv::LRQFeatures", "LoopDetectionExpireTime" },
{ "RasSrv::LRQFeatures", "LoopDetectionReprocessLCFs" },
{ "RasSrv::LRQFeatures", "LRQPingInterval" },
{ "RasSrv::LRQFeatures", "NeighborTimeout" },
{ "RasSrv::LRQFeatures", "PingAlias" },
Expand Down

0 comments on commit 3f00834

Please sign in to comment.