[mpls-linux-general] Re: 2 mall patches for ldpd
Status: Beta
Brought to you by:
jleu
From: James R. L. <jl...@mi...> - 2001-05-14 20:13:10
|
On Tue, May 08, 2001 at 03:52:15PM +0300, Eran Mann wrote: > Hi, > The first patch below fixes FEC prefix encoding (well, at least for me). I have question about this, see below: > The second fixes an informational printf. Applied. > (the patches are against the CVS tree with the message length patch > from http://www.geocrawler.com/archives/3/7968/2001/4/0/5654868/ > applied). I think that the above patch is applied in the CVS tree. With that patch were you only seeing mesg length problems when a FEC TLV existed or did you see mesg length problems across the board. You can easily check this out by turning on all tracing and compare the numbers at the end of the output coming from line 208 of ldp_buf.c or 428 of the same file. Thanks, Jim > > -- > Eran Mann Direct : 972-4-9936230 > Senior Software Engineer Fax : 972-4-9890430 > Optical Access Email : em...@op... > Index: ldp_label_mapping.c > =================================================================== > RCS file: /cvsroot/mpls-linux/ldp-portable/lib/ldp_label_mapping.c,v > retrieving revision 1.6 > diff -u -r1.6 ldp_label_mapping.c > --- ldp_label_mapping.c 2001/04/21 07:21:32 1.6 > +++ ldp_label_mapping.c 2001/05/08 11:57:25 > @@ -120,7 +120,7 @@ > if(ldp_fib_get_route(g->fib_handle,1,&dest,&route) != 1) { > /* JLEU: how to handle the multipath case */ > LDP_TRACE_LOG(g->user_data,LDP_TRACE_STATE_ALL,LDP_TRACE_FLAG_NORMAL, > - "No route to FEC (%08x/%d)\n",route.network.u.ipv4,route.prefix_len); > + "No route to FEC (%08x/%d)\n",dest.network.u.ipv4,dest.prefix_len); > return LDP_NO_ROUTE; > } > if(route.next_hop.protocol != 0) { > Index: ldp_nortel.c > =================================================================== > RCS file: /cvsroot/mpls-linux/ldp-portable/lib/ldp_nortel.c,v > retrieving revision 1.1.1.1 > diff -u -r1.1.1.1 ldp_nortel.c > --- ldp_nortel.c 2000/12/02 01:31:52 1.1.1.1 > +++ ldp_nortel.c 2001/05/08 11:49:44 > @@ -2707,14 +2707,14 @@ > } > case MPLS_PREFIX_FEC: > { > - fecAdrEl->addressEl.addressFam = htons(fecAdrEl->addressEl.addressFam); > - fecAdrEl->addressEl.address = htonl(fecAdrEl->addressEl.address); > + int preLenOctets = (int)(fecAdrEl->addressEl.preLen / 8) + > + ((int)(fecAdrEl->addressEl.preLen % 8) > 0 ? 1 : 0); > + > + fecAdrEl->addressEl.addressFam = htons(fecAdrEl->addressEl.addressFam); > + > + encodedSize = MPLS_FEC_ADRFAMLEN + MPLS_FEC_ELEMTYPELEN + > + MPLS_FEC_PRELENLEN + preLenOctets; > > - encodedSize = MPLS_FEC_ADRFAMLEN + MPLS_FEC_ELEMTYPELEN + > - MPLS_FEC_PRELENLEN + > - (int)(fecAdrEl->addressEl.preLen / 8) + > - ((int)(fecAdrEl->addressEl.preLen % 8) > 0 ? 1 : 0); > - > if (encodedSize > bufSize) > { > return MPLS_ENC_BUFFTOOSMALL; > @@ -2731,9 +2731,8 @@ > tempBuf++; /* for MPLS_FEC_PRELENLEN */ > > MEM_COPY( tempBuf, > - (u_char*)&(fecAdrEl->addressEl.address), > - (int)(fecAdrEl->addressEl.preLen / 8) + > - ((int)(fecAdrEl->addressEl.preLen % 8) > 0 ? 1 : 0)); > + (u_char*)(&(fecAdrEl->addressEl.address)), > + preLenOctets ); > break; > } > case MPLS_HOSTADR_FEC: -- James R. Leu |