summaryrefslogtreecommitdiffstats
path: root/sbin/routed/radix.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/radix.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/radix.c')
-rw-r--r--sbin/routed/radix.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sbin/routed/radix.c b/sbin/routed/radix.c
index 7f7e1e4..5feb655 100644
--- a/sbin/routed/radix.c
+++ b/sbin/routed/radix.c
@@ -30,18 +30,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)radix.c 8.4 (Berkeley) 11/2/94
*/
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)radix.c 8.4 (Berkeley) 11/2/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
/*
* Routines to build and maintain radix trees for routing lookups.
*/
-#if !defined(lint) && !defined(sgi) && !defined(__NetBSD__)
-static char sccsid[] = "@(#)rdisc.c 8.1 (Berkeley) x/y/95";
-#elif defined(__NetBSD__)
-static char rcsid[] = "$NetBSD$";
-#endif
-#ident "$Revision: 1.10 $"
#include "defs.h"
@@ -442,7 +443,8 @@ rn_addmask(void *n_arg, int search, int skip)
x = 0;
if (x || search)
return (x);
- R_Malloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x));
+ x = (struct radix_node *)
+ rtmalloc(max_keylen + 2 * sizeof (*x), "rn_addmask");
if ((saved_x = x) == 0)
return (0);
Bzero(x, max_keylen + 2 * sizeof (*x));
@@ -850,7 +852,7 @@ rn_inithead(void **head, int off)
register struct radix_node *t, *tt, *ttt;
if (*head)
return (1);
- R_Malloc(rnh, struct radix_node_head *, sizeof (*rnh));
+ rnh = (struct radix_node_head *)rtmalloc(sizeof (*rnh), "rn_inithead");
if (rnh == 0)
return (0);
Bzero(rnh, sizeof (*rnh));
@@ -881,7 +883,7 @@ rn_init(void)
printf("rn_init: radix functions require max_keylen be set\n");
return;
}
- R_Malloc(rn_zeros, char *, 3 * max_keylen);
+ rn_zeros = (char *)rtmalloc(3 * max_keylen, "rn_init");
if (rn_zeros == NULL)
panic("rn_init");
Bzero(rn_zeros, 3 * max_keylen);
OpenPOWER on IntegriCloud