summaryrefslogtreecommitdiffstats
path: root/sbin/routed/table.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1998-07-28 06:36:31 +0000
committercharnier <charnier@FreeBSD.org>1998-07-28 06:36:31 +0000
commitcd64002d5da7c3bacf30747f3a6af5baca8676a6 (patch)
tree083e700ad435744b33aa1ed531c4da6bb11f49b8 /sbin/routed/table.c
parent6999d30e2ecf654e56794fbef703e59c1826883a (diff)
downloadFreeBSD-src-cd64002d5da7c3bacf30747f3a6af5baca8676a6.zip
FreeBSD-src-cd64002d5da7c3bacf30747f3a6af5baca8676a6.tar.gz
Spelling, add rcsid, remove unused #includes.
Convert 1000000 usec to 1 sec 0 usec. Use provided safe malloc (rtmalloc()) instead of malloc(): exit on allocation failure. Correct use of .Nm Add usage() and use errx().
Diffstat (limited to 'sbin/routed/table.c')
-rw-r--r--sbin/routed/table.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index e224d41..1d95b12 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -31,11 +31,13 @@
* SUCH DAMAGE.
*/
-#if !defined(lint) && !defined(sgi) && !defined(__NetBSD__)
+#ifndef lint
+#if 0
static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 6/5/93";
-#elif defined(__NetBSD__)
-static char rcsid[] = "$NetBSD$";
#endif
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
#include "defs.h"
@@ -175,11 +177,11 @@ ag_del(struct ag_info *ag)
}
-/* Flush routes waiting for aggretation.
+/* Flush routes waiting for aggregation.
* This must not suppress a route unless it is known that among all
* routes with coarser masks that match it, the one with the longest
* mask is appropriate. This is ensured by scanning the routes
- * in lexical order, and with the most restritive mask first
+ * in lexical order, and with the most restrictive mask first
* among routes to the same destination.
*/
void
@@ -316,8 +318,8 @@ ag_check(naddr dst,
* A route to an address less than the current destination
* will not be affected by the current route or any route
* seen hereafter. That means it is safe to suppress it.
- * This check keeps poor routes (eg. with large hop counts)
- * from preventing suppresion of finer routes.
+ * This check keeps poor routes (e.g. with large hop counts)
+ * from preventing suppression of finer routes.
*/
if (ag_cors != 0
&& ag->ag_dst_h < dst
@@ -769,7 +771,7 @@ kern_add(naddr dst, naddr mask)
if (k != 0)
return k;
- k = (struct khash *)malloc(sizeof(*k));
+ k = (struct khash *)rtmalloc(sizeof(*k), "kern_add");
bzero(k, sizeof(*k));
k->k_dst = dst;
@@ -953,7 +955,7 @@ flush_kern(void)
DBGERR(1,"RT_DUMP-sysctl-estimate");
return;
}
- buf = malloc(needed);
+ buf = (char *)rtmalloc(needed, "flush_kern");
if (sysctl(mib, 6, buf, &needed, 0, 0) < 0)
BADERR(1,"RT_DUMP");
lim = buf + needed;
OpenPOWER on IntegriCloud