From 3d11b3b9ff65771aa24362c42c111c64999c88d3 Mon Sep 17 00:00:00 2001 From: jca Date: Thu, 24 Jul 2014 17:45:35 +0000 Subject: [PATCH] Unbreak ''route flush'': the kernel now adds local (RTF_LOCAL) routes for addresses configured on the system, and prevents userland from deleting them. Just skip those routes when flushing. Problem noticed by mlarkin@, ok henning@ mpi@ claudio@ sthen@ deraadt@ --- sbin/route/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index d9b9008938d..d85ce7ae799 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.168 2014/06/23 03:46:16 guenther Exp $ */ +/* $OpenBSD: route.c,v 1.169 2014/07/24 17:45:35 jca Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -320,6 +320,8 @@ flushroutes(int argc, char **argv) print_rtmsg(rtm, rtm->rtm_msglen); if ((rtm->rtm_flags & (RTF_GATEWAY|RTF_STATIC|RTF_LLINFO)) == 0) continue; + if ((rtm->rtm_flags & RTF_LOCAL) != 0) + continue; sa = (struct sockaddr *)(next + rtm->rtm_hdrlen); if (af && sa->sa_family != af) continue; -- 2.20.1