From d639e4e05c1e2c79a4a729f265dc741459fc2b19 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 16 Aug 2016 09:01:14 +0000 Subject: [PATCH] Mask the ``prio'' prior to comparing it to RTP_LOCAL. This allows rt_if_remove() to remove RTF_BROACAST routes from down interfaces. Issue reported by Dimitris Papastamos on bugs@ ok dlg@, claudio@, phessler@ --- sys/net/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index 52ae0c4d63f..c170dda1587 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.313 2016/07/22 11:03:30 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.314 2016/08/16 09:01:14 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -873,7 +873,7 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp, * kernel. */ if ((rt->rt_flags & (RTF_LOCAL|RTF_BROADCAST)) && - prio != RTP_LOCAL) { + (prio & RTP_MASK) != RTP_LOCAL) { rtfree(rt); return (EINVAL); } -- 2.20.1