From owner-freebsd-net@FreeBSD.ORG Wed May 18 15:36:42 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DB11065674 for ; Wed, 18 May 2011 15:36:42 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from no.spam.no.ddos.ru (no.spam.no.ddos.ru [IPv6:2a02:978:2:1000::3]) by mx1.freebsd.org (Postfix) with ESMTP id CCFFD8FC1C for ; Wed, 18 May 2011 15:36:41 +0000 (UTC) Received: from bibi.ipfw.ru (birdie.ipv6.meganet.ru [IPv6:2a02:978::1008]) by no.spam.no.ddos.ru (Postfix) with ESMTPA id 4FCD635C510; Wed, 18 May 2011 19:35:39 +0400 (MSD) Message-ID: <4DD3E713.3070008@ipfw.ru> Date: Wed, 18 May 2011 19:34:43 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110301 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Jack Shang(hongzhang)" References: <1305721909414-4406356.post@n5.nabble.com> <4DD3C17E.9070903@ipfw.ru> <78D2B330B6A30B4CB554FD2EC08D7434F3668E@szxeml508-mbx.china.huawei.com> In-Reply-To: <78D2B330B6A30B4CB554FD2EC08D7434F3668E@szxeml508-mbx.china.huawei.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit Cc: "freebsd-net@freebsd.org" Subject: Re: =?gb2312?b?tPC4tDogSXMgaXQgYSBidWcgb2YgUkFESVggPz8/Pz8=?= X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 15:36:42 -0000 On 18.05.2011 19:15, Jack Shang(hongzhang) wrote: > I do these by call the radix routine such as rn_addroute and rn_delete directly. Okay. Can you provide FreeBSD version and a piece of code triggering such a situation? IMHO radix assumes destination address to have host bits cleared, code in rtrequest1_fib does this via rt_maskedcopy(). Are you sure you need to pass 0x360AD0A2/30 0x360ADFEC/20 0x360AD082/30 instead of: 0x360AD0A0/30 0x360AD000/20 0x360AD080/30 ? > ________________________________________ > 发件人: Alexander V. Chernikov [melifaro@ipfw.ru] > 发送时间: 2011年5月18日 20:54 > 到: Jack Shang(hongzhang) > Cc: freebsd-net@freebsd.org > 主题: Re: Is it a bug of RADIX ????? > > On 18.05.2011 16:31, JACK wrote: >> After inserting the following IPv4 routers: >> >> 0x360AD0A2/30 >> 0x360ADFEC/20 >> 0x360AD082/30 >> >> I try to delete the above routes, when delete the second >> route(0x360ADFEC/20), the operation fail. > Can you specify exact commands you are issuing to add/remove routes? > (or "route monitor" output if you are doing this from some dynamic > routing software) > > The following order works for me (8.2-STABLE): > > 16:44 [0] bibi# route add -net 54.10.208.162/30 10.11.0.1 > add net 54.10.208.162: gateway 10.11.0.1 > 16:45 [0] bibi# route add -net 54.10.223.236/20 10.11.0.1 > add net 54.10.223.236: gateway 10.11.0.1 > 16:46 [0] bibi# route add -net 54.10.208.130/30 10.11.0.1 > add net 54.10.208.130: gateway 10.11.0.1 > > 16:46 [0] bibi# netstat -rn -finet | grep 54 > 54.10.208.0/20 10.11.0.1 UGS 0 0 em0 > 54.10.208.128/30 10.11.0.1 UGS 0 0 em0 > 54.10.208.160/30 10.11.0.1 UGS 0 0 em0 > 16:46 [0] bibi# route delete 54.10.208.0/20 > delete net 54.10.208.0 > 16:48 [0] bibi# route delete 54.10.208.128/30 > delete net 54.10.208.128 > 16:49 [0] bibi# route delete 54.10.208.160/30 > delete net 54.10.208.160 > 16:49 [0] bibi# netstat -rn -finet | grep 54 > 16:49 [0] bibi# > > >> struct radix_node * rn_delete (........) >> { >> ... >> /* >> * Delete our route from mask lists. >> */ >> if (netmask != NULL) { >> if ((x = rn_addmask(netmask, TRUE, head_off)) == NULL) >> return (NULL); >> netmask = x->rn_key; >> while (tt->rn_mask != netmask) >> if ((tt = tt->rn_dupedkey) == NULL) >> return (NULL); // rn_delete return here!!! >> } >> ... >> } >> >> but, if I delete as the following order, all routers was deleted >> successfully: >> >> 0x360AD0A2/30 >> 0x360AD082/30 >> 0x360ADFEC/20 >> >> >> so, is it a bug of RADIX? >> >> /jack >> >> >> >> >> -- >> View this message in context: http://freebsd.1045724.n5.nabble.com/Is-it-a-bug-of-RADIX-tp4406356p4406356.html >> Sent from the freebsd-net mailing list archive at Nabble.com. >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"