Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Nov 2011 19:29:03 +0000 (UTC)
From:      Qing Li <qingli@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r227003 - stable/8/sys/net
Message-ID:  <201111011929.pA1JT3lq080514@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111011929.pA1JT3lq080514>