From 46a70de2b083be0ca31b4f79904b3e7fb7351e48 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Tue, 25 Oct 2011 00:34:39 +0000 Subject: [PATCH] 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 --- sys/net/route.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/net/route.c b/sys/net/route.c index fafa081c99b..85a2c840a0d 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1025,6 +1025,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, 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_addrinfo *info, struct rtentry **ret_nrt, 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);