diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1996-08-27 16:13:00 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1996-08-27 16:13:00 +0000 |
commit | 38cfd0b437d4376607181b9329b6e39940d8a553 (patch) | |
tree | 532c9e8ae13ddb3e682aeaf586e35ac1243a2f34 /usr.sbin/routed/output.c | |
parent | 1823680765faa251d4ecd9229988ba71fce9c175 (diff) | |
download | src-test2-38cfd0b437d4376607181b9329b6e39940d8a553.tar.gz src-test2-38cfd0b437d4376607181b9329b6e39940d8a553.zip |
Notes
Diffstat (limited to 'usr.sbin/routed/output.c')
-rw-r--r-- | usr.sbin/routed/output.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/usr.sbin/routed/output.c b/usr.sbin/routed/output.c index 8750c412dfd3..be30609743a7 100644 --- a/usr.sbin/routed/output.c +++ b/usr.sbin/routed/output.c @@ -31,11 +31,12 @@ * SUCH DAMAGE. */ -#if !defined(lint) && !defined(sgi) +#if !defined(lint) && !defined(sgi) && !defined(__NetBSD__) static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 6/5/93"; -#endif /* not lint */ - -#ident "$Revision: 1.14 $" +#elif defined(__NetBSD__) +static char rcsid[] = "$NetBSD$"; +#endif +#ident "$Revision: 1.16 $" #include "defs.h" @@ -61,6 +62,7 @@ struct { } v12, v2; char metric; /* adjust metrics by interface */ int npackets; + int gen_limit; u_int state; #define WS_ST_FLASH 0x001 /* send only changed routes */ #define WS_ST_RIP2_SAFE 0x002 /* send RIPv2 safe for RIPv1 */ @@ -170,6 +172,10 @@ output(enum output_type type, } sin.sin_addr.s_addr = htonl(INADDR_RIP_GROUP); } + + case NO_OUT_MULTICAST: + case NO_OUT_RIPV2: + break; } trace_rip(msg, "to", &sin, ifp, buf, size); @@ -297,20 +303,22 @@ supply_out(struct ag_info *ag) ddst_h = v1_mask & -v1_mask; i = (v1_mask & ~mask)/ddst_h; - if (i >= 1024) { + if (i > ws.gen_limit) { /* Punt if we would have to generate an * unreasonable number of routes. */ #ifdef DEBUG - msglog("sending %s to %s as-is instead" - " of as %d routes", - addrname(htonl(dst_h),mask,0), - naddr_ntoa(ws.to.sin_addr.s_addr), i); + msglog("sending %s to %s as 1 instead" + " of %d routes", + addrname(htonl(dst_h),mask,1), + naddr_ntoa(ws.to.sin_addr.s_addr), + i+1); #endif i = 0; } else { mask = v1_mask; + ws.gen_limit -= i; } } } @@ -539,6 +547,7 @@ supply(struct sockaddr_in *dst, ws.state = 0; + ws.gen_limit = 1024; ws.to = *dst; ws.to_std_mask = std_mask(ws.to.sin_addr.s_addr); |