svn commit: r227003 - stable/8/sys/net

Qing Li qingli at
Tue Nov 1 19:29:04 UTC 2011

Author: qingli
Date: Tue Nov  1 19:29:03 2011
New Revision: 227003

  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.

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;
+		}
 		if (rn_mpath_capable(rnh)) {
 			error = rn_mpath_update(req, info, rnh, ret_nrt);

More information about the svn-src-stable-8 mailing list