From owner-svn-src-stable@FreeBSD.ORG Tue Nov 1 19:29:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF3F2106566C; Tue, 1 Nov 2011 19:29:03 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB608FC17; Tue, 1 Nov 2011 19:29:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA1JT39S080516; Tue, 1 Nov 2011 19:29:03 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA1JT3lq080514; Tue, 1 Nov 2011 19:29:03 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201111011929.pA1JT3lq080514@svn.freebsd.org> From: Qing Li Date: Tue, 1 Nov 2011 19:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227003 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2011 19:29:04 -0000 Author: qingli Date: Tue Nov 1 19:29:03 2011 New Revision: 227003 URL: http://svn.freebsd.org/changeset/base/227003 Log: MFC 226710 The host-id/interface-id can have a specific value and is properly masked out when adding a prefix route through the "route" command. However, when deleting the route, simply changing the command keyword from "add" to "delete" does not work. The failoure is observed in both IPv4 and IPv6 route insertion. The patch makes the route command behavior consistent between the "add" and the "delete" operation. Modified: stable/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Tue Nov 1 18:29:06 2011 (r227002) +++ stable/8/sys/net/route.c Tue Nov 1 19:29:03 2011 (r227003) @@ -1031,6 +1031,7 @@ rtrequest1_fib(int req, struct rt_addrin register struct radix_node_head *rnh; struct ifaddr *ifa; struct sockaddr *ndst; + struct sockaddr_storage mdst; #define senderr(x) { error = x ; goto bad; } KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); @@ -1057,6 +1058,10 @@ rtrequest1_fib(int req, struct rt_addrin switch (req) { case RTM_DELETE: + if (netmask) { + rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); + dst = (struct sockaddr *)&mdst; + } #ifdef RADIX_MPATH if (rn_mpath_capable(rnh)) { error = rn_mpath_update(req, info, rnh, ret_nrt);