Re: [mpls-linux-devel] A few problems with ldpd
Status: Beta
Brought to you by:
jleu
From: James R. L. <jl...@mi...> - 2008-05-12 03:31:44
|
I've submitted an alternate patch to solve this issue. I make a call checking if_is_loopback() on the ifp and skip accordingly. In addition the quagga-mpls tree in my development depot has been update to solve a couple of nagging bugs. Anyone working with quagga-mpls will want to pull the latest updates. On Tue, Mar 25, 2008 at 03:33:03PM -0400, Scott A. Yoder wrote: > Yeah that did solve the problem but isn't there some way to control which addresses > are announced to peers? It seems like the address-mode lsr-id doesn't cause ldpd to only announce > the configured lsr-id. > > Here's a little patch to stop registering loopback addresses. Does Quagga have a LOOPBACK() macro > like the kernel? I could only find an INADDR_LOOPBACK define. > > --- ldp_zebra.c Wed Mar 26 00:05:22 2008 > +++ ldp_zebra-new.c Tue Mar 25 23:44:43 2008 > @@ -201,16 +201,20 @@ > c = zebra_interface_address_read(command, zclient->ibuf); > if (c == NULL || c->address->family != AF_INET) { > return 0; > } > > ifp = c->ifp; > p = c->address; > > + /* Don't register loopback addresses */ > + if (((p->u.prefix4.s_addr) & htonl(0xff000000)) == htonl(0x7f000000)) > + return 0; > + > zlog_info("address add %s to interface %s",inet_ntoa(p->u.prefix4), > ifp->name); > > if (ldp) { > prefix2mpls_inet_addr(p, &addr.address); > iff.handle = ifp; > ldp_cfg_if_addr_set(ldp->h, &iff, &addr, LDP_CFG_ADD); > > > Scott Yoder > Support Engineer > ImageStream Internet Solutions, Inc. > E-mail: sy...@im... > > James R. Leu wrote: > > Good stuff. Thank you for working with ldp-portable and taking the > > time to dig into the code. I've incorporated your fixes for the memory > > leaks and I'm double checking the byte order fix you suggest. > > > > As far as the multiple session issue, I think the fix is to never > > send any 127.0.0.0/8 addresses in the address message. One way to > > accomplish this is to never register 127.0.0.0/8 addresses with > > LDP by modifing ldp_interface_address_add() in ldp_zebra.c. > > > > On Mon, Mar 24, 2008 at 04:58:20PM -0400, Scott A. Yoder wrote: > >> Hi James. I've been able to get ldpd working quite well with 3 routers in my testbed. Even > >> the targeted ldp sessions now appear to be working. I have a left LSR, middle, LSR and right LSR. The > >> targeted session is between the left and right routers. > >> > >> I've found a few problems and want to get your take on how best to fix them. > >> > >> 1) The xconnect command needs to have the destination IP address stored in host byte order. > >> > >> --- ldp_vty.c Tue Mar 25 01:19:59 2008 > >> +++ ldp_vty-new.c Wed Mar 19 01:55:44 2008 > >> @@ -1618,6 +1618,7 @@ > >> dest.port = 646; > >> > >> VTY_GET_UINT32_RANGE("VCID",vcid,argv[1],0,255); > >> + dest.addr.u.ipv4 = ntohl(dest.addr.u.ipv4); > >> > >> if (ldp_remote_peer_find(ldp, &dest)) { > >> return CMD_WARNING; > >> > >> > >> 2) I found a couple of memory leaks with valgrind: > >> > >> --- ldp_session.c Fri Jan 4 23:58:59 2008 > >> +++ ldp_session-new.c Tue Mar 25 01:25:32 2008 > >> @@ -252,6 +252,8 @@ > >> { > >> LDP_PRINT(NULL, "session delete"); > >> MPLS_REFCNT_ASSERT(s, 0); > >> + ldp_buf_delete(s->tx_buffer); > >> + ldp_mesg_delete(s->tx_message); > >> mpls_free(s); > >> } > >> > >> --- ldp_buf.c Tue Mar 25 01:29:01 2008 > >> +++ ldp_buf-new.c Fri Mar 21 21:18:06 2008 > >> @@ -49,6 +49,8 @@ > >> void ldp_buf_delete(ldp_buf * b) > >> { > >> MPLS_ASSERT(b); > >> + if (b->buffer) > >> + mpls_free(b->buffer); > >> mpls_free(b); > >> } > >> > >> > >> These 2 leaks caused ldpd to grow several megabytes per hour on my system. > >> > >> > >> 3) ldpd cannot establish more than 1 session at a time. > >> > >> I don't know if I have a config error but I keep getting a "ldp_addr_process: session X already advertised this address" > >> error when the 2nd router attempts to start up a session. I think the address is 127.0.0.1. I tried changing the lsr-id and > >> transport address but that caused ldpd to crash. The neighbor's status is stuck in the discovery state. > >> > >> Just to get around this problem and keep going I stuck a return MPLS_SUCCESS in ldpd/ldp_addr.c line 315: > >> > >> /* the addr is in the tree */ > >> if (addr->session) { > >> LDP_PRINT(g->user_data, > >> "ldp_addr_process: session (%d) already advertised this address\n", > >> addr->session->index); > >> return MPLS_SUCCESS; > >> return MPLS_FAILURE; > >> } > >> > >> Is there something I'm missing with the config to support multiple peers? > >> > >> Thanks, > >> Scott Yoder > >> Support Engineer > >> ImageStream Internet Solutions, Inc. > >> E-mail: sy...@im... > >> > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by: Microsoft > >> Defy all challenges. Microsoft(R) Visual Studio 2008. > >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > >> _______________________________________________ > >> mpls-linux-devel mailing list > >> mpl...@li... > >> https://lists.sourceforge.net/lists/listinfo/mpls-linux-devel > > -- James R. Leu jl...@mi... |