summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/route.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 34eb9142e59..d96c72f2617 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.79 2006/06/16 16:49:39 henning Exp $ */
+/* $OpenBSD: route.c,v 1.80 2006/06/17 17:20:00 pascoe Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -778,6 +778,15 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
rt->rt_parent = NULL;
}
+#ifndef SMALL_KERNEL
+ if (rn_mpath_capable(rnh)) {
+ if ((rn = rnh->rnh_lookup(info->rti_info[RTAX_DST],
+ info->rti_info[RTAX_NETMASK], rnh)) != NULL &&
+ rn_mpath_next(rn) == NULL)
+ ((struct rtentry *)rn)->rt_flags &= ~RTF_MPATH;
+ }
+#endif
+
rt->rt_flags &= ~RTF_UP;
if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
ifa->ifa_rtrequest(RTM_DELETE, rt, info);
@@ -880,6 +889,18 @@ makeroute:
pool_put(&rtentry_pool, rt);
senderr(EEXIST);
}
+
+#ifndef SMALL_KERNEL
+ if (rn_mpath_capable(rnh)) {
+ rn = rnh->rnh_lookup(info->rti_info[RTAX_DST],
+ info->rti_info[RTAX_NETMASK], rnh);
+ if (rn_mpath_next(rn) == NULL)
+ ((struct rtentry *)rn)->rt_flags &= ~RTF_MPATH;
+ else
+ ((struct rtentry *)rn)->rt_flags |= RTF_MPATH;
+ }
+#endif
+
if (ifa->ifa_rtrequest)
ifa->ifa_rtrequest(req, rt, info);
if (ret_nrt) {