PR/40455: Mihai Chelaru: Add noreject noblackhole options

This commit is contained in:
christos 2010-05-12 17:56:13 +00:00
parent 5bc4943cb2
commit c69676936c
4 changed files with 30 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: keywords.c,v 1.6 2006/08/06 17:44:56 dyoung Exp $ */
/* $NetBSD: keywords.c,v 1.7 2010/05/12 17:56:13 christos Exp $ */
/* WARNING! This file was generated by keywords.sh */
@ -57,6 +57,8 @@ struct keytab keywords[] = {
{"xns", K_XNS},
{"xresolve", K_XRESOLVE},
{"flushall", K_FLUSHALL},
{"noblackhole", K_NOBLACKHOLE},
{"noreject", K_NOREJECT},
{0, 0}
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: keywords.h,v 1.9 2006/08/06 17:44:56 dyoung Exp $ */
/* $NetBSD: keywords.h,v 1.10 2010/05/12 17:56:13 christos Exp $ */
/* WARNING! This file was generated by keywords.sh */
@ -59,3 +59,5 @@ extern struct keytab {
#define K_FLUSHALL 49
#define K_NOCLONED 50
#define K_NOCLONING 51
#define K_NOBLACKHOLE 52
#define K_NOREJECT 53

View File

@ -1,4 +1,4 @@
.\" $NetBSD: route.8,v 1.40 2006/08/06 23:38:13 wiz Exp $
.\" $NetBSD: route.8,v 1.41 2010/05/12 17:56:13 christos Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -267,19 +267,21 @@ when sending to destinations matched by the routes.
These flags may be set (or sometimes cleared)
by indicating the following corresponding modifiers:
.Bd -literal
-cloning RTF_CLONING - generates a new route on use
-nocloning ~RTF_CLONING - stop generating new routes on use
-cloned RTF_CLONED - cloned route generated by RTF_CLONING
-nocloned ~RTF_CLONED - prevent removal with RTF_CLONING parent
-xresolve RTF_XRESOLVE - emit mesg on use (for external lookup)
-iface ~RTF_GATEWAY - destination is directly reachable
-static RTF_STATIC - manually added route
-nostatic ~RTF_STATIC - pretend route added by kernel or daemon
-reject RTF_REJECT - emit an ICMP unreachable when matched
-blackhole RTF_BLACKHOLE - silently discard pkts (during updates)
-proto1 RTF_PROTO1 - set protocol specific routing flag #1
-proto2 RTF_PROTO2 - set protocol specific routing flag #2
-llinfo RTF_LLINFO - validly translates proto addr to link addr
-cloning RTF_CLONING - generates a new route on use
-nocloning ~RTF_CLONING - stop generating new routes on use
-cloned RTF_CLONED - cloned route generated by RTF_CLONING
-nocloned ~RTF_CLONED - prevent removal with RTF_CLONING parent
-xresolve RTF_XRESOLVE - emit mesg on use (for external lookup)
-iface ~RTF_GATEWAY - destination is directly reachable
-static RTF_STATIC - manually added route
-nostatic ~RTF_STATIC - pretend route added by kernel or daemon
-reject RTF_REJECT - emit an ICMP unreachable when matched
-noreject ~RTF_REJECT - clear reject flag
-blackhole RTF_BLACKHOLE - silently discard pkts (during updates)
-noblackhole ~RTF_BLACKHOLE - clear blackhole flag
-proto1 RTF_PROTO1 - set protocol specific routing flag #1
-proto2 RTF_PROTO2 - set protocol specific routing flag #2
-llinfo RTF_LLINFO - validly translates proto addr to link addr
.Ed
.Pp
The optional modifiers

View File

@ -1,4 +1,4 @@
/* $NetBSD: route.c,v 1.119 2008/12/28 20:12:31 christos Exp $ */
/* $NetBSD: route.c,v 1.120 2010/05/12 17:56:13 christos Exp $ */
/*
* Copyright (c) 1983, 1989, 1991, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1991, 1993\
#if 0
static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: route.c,v 1.119 2008/12/28 20:12:31 christos Exp $");
__RCSID("$NetBSD: route.c,v 1.120 2010/05/12 17:56:13 christos Exp $");
#endif
#endif /* not lint */
@ -843,9 +843,15 @@ newroute(int argc, char *const *argv)
case K_REJECT:
flags |= RTF_REJECT;
break;
case K_NOREJECT:
flags &= ~RTF_REJECT;
break;
case K_BLACKHOLE:
flags |= RTF_BLACKHOLE;
break;
case K_NOBLACKHOLE:
flags &= ~RTF_BLACKHOLE;
break;
case K_CLONED:
flags |= RTF_CLONED;
break;