From 3333e32aa0648d39817d05f9a727a956ee34e750 Mon Sep 17 00:00:00 2001 From: John Hay Date: Sat, 24 Apr 1999 09:18:49 +0000 Subject: [PATCH] Add an option to disable responses to SAP_GETNEAREST_SERVER requests. Submitted by: Boris Popov --- usr.sbin/IPXrouted/IPXrouted.8 | 3 +++ usr.sbin/IPXrouted/defs.h | 3 ++- usr.sbin/IPXrouted/main.c | 9 +++++++-- usr.sbin/IPXrouted/sap_input.c | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/usr.sbin/IPXrouted/IPXrouted.8 b/usr.sbin/IPXrouted/IPXrouted.8 index 79779d5dc53f..71fb1ebbed41 100644 --- a/usr.sbin/IPXrouted/IPXrouted.8 +++ b/usr.sbin/IPXrouted/IPXrouted.8 @@ -39,6 +39,7 @@ .Nd IPX Routing Information Protocol daemon .Sh SYNOPSIS .Nm IPXrouted +.Op Fl N .Op Fl q .Op Fl s .Op Fl S @@ -53,6 +54,8 @@ table entries. .Pp Available options: .Bl -tag -width logfile +.It Fl N +Do not reply on GetNearestServer SAP request. .It Fl q Do not supply routing information (opposite of .Fl s diff --git a/usr.sbin/IPXrouted/defs.h b/usr.sbin/IPXrouted/defs.h index 55e08b34c3aa..207b810c825d 100644 --- a/usr.sbin/IPXrouted/defs.h +++ b/usr.sbin/IPXrouted/defs.h @@ -34,7 +34,7 @@ * * @(#)defs.h 8.1 (Berkeley) 6/5/93 * - * $Id: defs.h,v 1.5 1997/02/22 16:00:55 peter Exp $ + * $Id: defs.h,v 1.6 1997/07/06 07:38:27 jhay Exp $ */ #include @@ -77,6 +77,7 @@ extern int sapsock; /* Socket to listen on */ extern int kmem; extern int supplier; /* process should supply updates */ extern int dosap; /* SAP is enabled */ +extern int dognreply; /* enable GET_NEAREST response */ extern int install; /* if 1 call kernel */ extern int lookforinterfaces; /* if 1 probe kernel for new up ifs */ extern int performnlist; /* if 1 check if /kernel has changed */ diff --git a/usr.sbin/IPXrouted/main.c b/usr.sbin/IPXrouted/main.c index 9af5b2ec95cb..821e1258d206 100644 --- a/usr.sbin/IPXrouted/main.c +++ b/usr.sbin/IPXrouted/main.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: main.c,v 1.6 1997/02/22 16:00:57 peter Exp $ + * $Id: main.c,v 1.7 1997/07/06 07:38:30 jhay Exp $ */ #ifndef lint @@ -147,8 +147,13 @@ main(argc, argv) argv++, argc--; continue; } + if (strcmp(*argv, "-N") == 0) { + dognreply = 0; + argv++, argc--; + continue; + } fprintf(stderr, - "usage: ipxrouted [ -s ] [ -q ] [ -t ] [ -g ] [ -l ]\n"); + "usage: ipxrouted [ -s ] [ -q ] [ -t ] [ -g ] [ -l ] [ -N ]\n"); exit(1); } diff --git a/usr.sbin/IPXrouted/sap_input.c b/usr.sbin/IPXrouted/sap_input.c index 26130fed7eed..5470c2686633 100644 --- a/usr.sbin/IPXrouted/sap_input.c +++ b/usr.sbin/IPXrouted/sap_input.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sap_input.c,v 1.4 1997/02/22 16:00:59 peter Exp $ + * $Id: sap_input.c,v 1.5 1997/07/06 07:38:31 jhay Exp $ */ /* @@ -36,6 +36,7 @@ */ #include "defs.h" +int dognreply = 1; /* * Process a newly received packet. @@ -78,6 +79,8 @@ sap_input(from, size) case SAP_REQ_NEAR: if (ftrace) fprintf(ftrace, "Received a sap REQ_NEAR packet.\n"); + if (!dognreply) + return; sap = sap_nearestserver(n->ServType, ifp); if (sap == NULL) return;