Author: qingli
Date: Tue Oct 25 00:34:39 2011
New Revision: 226710
URL: http://svn.freebsd.org/changeset/base/226710

Log:
  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.
  
  MFC after:    1 week

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c        Mon Oct 24 23:38:11 2011        (r226709)
+++ head/sys/net/route.c        Tue Oct 25 00:34:39 2011        (r226710)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to