summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/route.c12
-rw-r--r--sys/net/rtsock.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index f942a526616..8327614ca79 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.364 2017/07/30 18:18:08 florian Exp $ */
+/* $OpenBSD: route.c,v 1.365 2017/08/02 07:42:11 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -722,16 +722,6 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp,
return (ESRCH);
}
- /*
- * If we got multipath routes, we require users to specify
- * a matching gateway.
- */
- if ((rt->rt_flags & RTF_MPATH) &&
- info->rti_info[RTAX_GATEWAY] == NULL) {
- rtfree(rt);
- return (ESRCH);
- }
-
#ifdef BFD
if (ISSET(rt->rt_flags, RTF_BFD))
bfdclear(rt);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 825874ea2e8..5f12aca5f76 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.245 2017/07/30 18:18:08 florian Exp $ */
+/* $OpenBSD: rtsock.c,v 1.246 2017/08/02 07:42:11 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -788,6 +788,16 @@ rtm_output(struct rt_msghdr *rtm, struct rtentry **prt,
break;
}
+ /*
+ * If we got multipath routes, we require users to specify
+ * a matching gateway.
+ */
+ if (ISSET(rt->rt_flags, RTF_MPATH) &&
+ info->rti_info[RTAX_GATEWAY] == NULL) {
+ error = ESRCH;
+ break;
+ }
+
/* Detaching an interface requires the KERNEL_LOCK(). */
ifp = if_get(rt->rt_ifidx);
KASSERT(ifp != NULL);