Re: Neighboring question[SOLVED-bugfix]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think if the hopCount field is missing, the LRQ should not be forwarded, 
so the original code is working well in this case. Any other opinions?

----- Original Message ----- 
From: "Thomas" <thomasj@xxxxxxxxx>
Sent: Saturday, March 20, 2004 1:21 AM


> The bug description was sent to the users list, however after looking
> for the source codes I found that this is not a configuration issue
> but a bug in code (most probably).
> 
> Short description:
> The ForwardHopCount option was not used in routing decision.
> 
> Longer description:
> 
> bool NeighborPolicy::OnRequest(LocationRequest & lrq_obj)
> {
>         RasMsg *ras = lrq_obj.GetWrapper();
>         List::iterator iter = find_if(m_neighbors.begin(), m_neighbors.end(), bind2nd(mem_fun(&Neighbor::IsAcceptable), ras));
>         Neighbor *requester = (iter != m_neighbors.end()) ? *iter : 0;
>         int hopCount = 0;
>         if (requester)
>                 if (requester->ForwardLRQ() < 0)
>                         return false;
>                 else if (requester->ForwardLRQ() > 0)
>                         hopCount = 1;
> 
>         H225_LocationRequest & lrq = (*ras)->m_recvRAS;
>         if (lrq.HasOptionalField(H225_LocationRequest::e_hopCount)) {
>                 hopCount = lrq.m_hopCount - 1;
>                 if (hopCount)
>                         lrq.m_hopCount = hopCount;
>         }
>         if (!hopCount)
>                 return false;
> 
> If I set ForwardLRQ=always, I had a  good workaround. The default
> ForwardLRQ's values is depends, which is not handled in previouse
> code. So hopCount=0.
> The LRQ request had no hopCount field, so the hopCount variable
> remained 0, thus the OnRequest function returned with false.
> 
> Here is a simple bugfix (I'm not sure if it is 100% correct) agains
> anon. CVS (2_2):
>  cvs diff -u Neighbor.cxx
> Index: Neighbor.cxx
> ===================================================================
> RCS file: /cvsroot/openh323gk/openh323gk/Neighbor.cxx,v
> retrieving revision 1.19
> diff -u -r1.19 Neighbor.cxx
> --- Neighbor.cxx        9 Mar 2004 11:36:42 -0000       1.19
> +++ Neighbor.cxx        19 Mar 2004 23:57:54 -0000
> @@ -853,6 +853,11 @@
>                         return false;
>                 else if (requester->ForwardLRQ() > 0)
>                         hopCount = 1;
> +               else {
> +                       hopCount = requester->GetDefaultHopCount() - 1;
> +                       if (hopCount < 0)
> +                               hopCount = 0;
> +               }
> 
>         H225_LocationRequest & lrq = (*ras)->m_recvRAS;
>         if (lrq.HasOptionalField(H225_LocationRequest::e_hopCount)) {
> 
> Kind regards,
>         Thomas
> 
> Friday, March 19, 2004, 8:57:25 PM, Thomas wrote:
> T> Hello,
> 
> T> I have 3 GKs interconnected theirselves with neighboring.
> T> GK1-GK2-GK3
> T> I would like to forward LRQs on GK2 coming from GK1 to GK3. I set up
> T> routing but somehow it doesn't  work.
> T> 2004/03/19 20:17:27.289 5                job.cxx(186)   JOB    
> T> Starting Job LRQ at Worker thread 9223
> T> 2004/03/19 20:17:27.289 1             RasSrv.cxx(306)   RAS     LRQ Received
> T> 2004/03/19 20:17:27.289 2            Toolkit.cxx(291)
> T> RewritePString: 111111 to 1212#1111
> T> 2004/03/19 20:17:27.289 4               gkauth.h(113)   GkAuth  default check ok
> T> 2004/03/19 20:17:27.289 5              Routing.h(117)   ROUTING
> T> Checking policy Internal for the request LRQ 59
> T> 2004/03/19 20:17:27.289 5              Routing.h(117)   ROUTING
> T> Checking policy Neighbor for the request LRQ 59
> T> 2004/03/19 20:17:27.289 2             RasSrv.cxx(351)
> T> LRJ|<gk1ip>|1212#111:dialedDigits|<gk1id>|requestDenied
> 
> T> Call from an endpoint registered under GK2 goes normally to GK3
> T> through LRQ, so I don't think it's the problem. Also, I can call from
> T> an endpoint registered to GK1 an endpoint registered under GK2.
> 
> T> Configuration on GK2:
> T> [RasSrv::LRQFeatures]
> T> NeighborTimeout=2
> T> IncludeDestinationInfoInLCF=1
> T> CiscoGKCompatible=1
> T> ForwardHopCount=2
> T> AcceptForwardedLRQ=1
> T> ForwardResponse=1
> 
> T> [Neighbor::GK3]
> T> Host=<gk3ip>
> T> Dynamic=0
> T> SendPrefixes=1212#
> T> AcceptForwardedLRQ=1
> 
> T> [Neighbor::GK1]
> T> Host=<gk1ip>
> T> Dynamic=0
> T> AcceptPrefixes=1212#
> T> AcceptForwardedLRQ=1
> T> ForwardHopCount=2
> 
> T> [RoutingPolicy]
> T> Default=internal,neighbor,parent
> 
> T> Thanks in advance,
> T>         Thomas



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux