summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2011-10-25 00:34:39 +0000
committerqingli <qingli@FreeBSD.org>2011-10-25 00:34:39 +0000
commit9ae130094e47bb0d823a87f3a50fa4915fcd00a1 (patch)
tree86fb803c6b897404794487100e5eb45701f66307 /sys/net
parentc9a1e7f1ad6d72c82b80127f615fe80ad9e34009 (diff)
downloadFreeBSD-src-9ae130094e47bb0d823a87f3a50fa4915fcd00a1.zip
FreeBSD-src-9ae130094e47bb0d823a87f3a50fa4915fcd00a1.tar.gz
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
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index fafa081..85a2c84 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);
OpenPOWER on IntegriCloud