From owner-freebsd-net@FreeBSD.ORG Sat Oct 22 06:40:30 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 BCCDA106564A for ; Sat, 22 Oct 2011 06:40:30 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id A2EDA8FC15 for ; Sat, 22 Oct 2011 06:40:30 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p9M6eTa7029837 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Fri, 21 Oct 2011 23:40:29 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0289.001; Fri, 21 Oct 2011 23:40:24 -0700 From: "Li, Qing" To: "freebsd-net@freebsd.org" Thread-Topic: patch for route deletion issue Thread-Index: AcyQhXKAYQMDJ5ntTdmcPFcZhEQWlA== Date: Sat, 22 Oct 2011 06:40:23 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: patch for route deletion issue 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: Sat, 22 Oct 2011 06:40:30 -0000 The host-id/interface-id can have a specific value and is properly masked o= ut when=20 adding a prefix route. As in route add -net 192.103.54.9/24 10.9.44.1 =20 OR for IPv6 route add -inet6 -net 2001:db8:1::1/48 2001:418:1800::1 The problem is when deleting the route, simply changing the command keyword from "add" to "delete" does not work. In other words, route delete -net 192.103.54.9/24 10.9.44.1 =20 OR for IPv6 route delete -inet6 -net 2001:db8:1::1/48 2001:418:1800::1 will return a route-not-found error. However, issue the command with the ho= st-id or interface-id cleared works, as in: route add -inet 192.103.54.0/24 10.9.44.1 OR for IPv6 route delete -inet6 -net 2001:db8:1::/48 2001:418:1800::1 The failure has been observed on 7.x, 8.x, 9.x and -current. The route command behavior should be consistent between "add" and "delete". In addition, providing the proper prefix value can be a bit of work dependi= ng on the prefix length. The patch that fixes the described issue sits in=20 http://people.freebsd.org/~qingli/route.c.diff Please apply this patch and report issues if any. I intend to commit the patch in a few days. Thanks, -- Qing