From: jca Date: Thu, 24 Jul 2014 17:45:35 +0000 (+0000) Subject: Unbreak ''route flush'': the kernel now adds local (RTF_LOCAL) routes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3d11b3b9ff65771aa24362c42c111c64999c88d3;p=openbsd 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@ --- 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;