svn commit: r227008 - stable/9/sys/net

Qing Li qingli at FreeBSD.org
Tue Nov 1 22:22:47 UTC 2011


Author: qingli
Date: Tue Nov  1 22:22:46 2011
New Revision: 227008
URL: http://svn.freebsd.org/changeset/base/227008

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.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/net/route.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/net/route.c
==============================================================================
--- stable/9/sys/net/route.c	Tue Nov  1 22:00:49 2011	(r227007)
+++ stable/9/sys/net/route.c	Tue Nov  1 22:22:46 2011	(r227008)
@@ -1025,6 +1025,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"));
@@ -1051,6 +1052,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);


More information about the svn-src-stable mailing list