diff --git a/sys/net/radix.c b/sys/net/radix.c
index 1a11f109ba0..dc59ce38f40 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -48,7 +48,7 @@
 #else
 #include <stdio.h>
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 #include <syslog.h>
 #endif
 #include <net/radix.h>
@@ -78,8 +78,17 @@
 static struct radix_mask *rn_mkfreelist[MAXCPU];
 static struct radix_node_head *mask_rnheads[MAXCPU];
 
+/*
+ * We do this statically now because the dynamic initialization
+ * occurs too late and has an ordering problem w/ pf preloads
+ * vs protocol domains.
+ */
 static const u_char rn_zeros[RN_MAXKEYLEN];
-static const u_char rn_ones[RN_MAXKEYLEN] = RN_MAXKEYONES;
+static const u_char rn_ones[RN_MAXKEYLEN] =
+	{ 255, 255, 255, 255, 255, 255, 255, 255,
+	  255, 255, 255, 255, 255, 255, 255, 255,
+	  255, 255, 255, 255, 255, 255, 255, 255,
+	  255, 255, 255, 255, 255, 255, 255, 255 };
 
 #ifdef RN_DEBUG
 static int rn_nodenum;
@@ -350,7 +359,7 @@ rn_match(const void *key, struct radix_node_head *head)
 	test = (*cp ^ *cp2) & 0xff;
 	for (bit = 7; (test >>= 1) > 0;)
 		bit--;
-	matched_off = cp - (const u_char *)key;
+	matched_off = (int)(cp - (const u_char *)key);
 	bit += matched_off << 3;
 	rn_bit = -1 - bit;
 
@@ -414,16 +423,16 @@ rn_match(const void *key, struct radix_node_head *head)
  * leaf is the left child of the parent node.
  */
 static struct radix_node *
-rn_newpair(const void *key, int bit, struct radix_node nodes[2])
+rn_newpair(const void *key, unsigned int bit, struct radix_node nodes[2])
 {
 	struct radix_node *left, *parent;
 
 	left = &nodes[0];
 	parent = &nodes[1];
 
-	parent->rn_bit = bit;
-	parent->rn_bmask = 0x80 >> (bit & 0x7);
-	parent->rn_offset = bit >> 3;
+	parent->rn_bit = (int)bit;
+	parent->rn_bmask = (u_char)(0x80 >> (bit & 0x7));
+	parent->rn_offset = (int)(bit >> 3);
 	parent->rn_left = left;
 	parent->rn_flags = RNF_ACTIVE;
 	parent->rn_mklist = NULL;
@@ -487,7 +496,8 @@ rn_insert(const void *key, struct radix_node_head *head, bool *dupentry,
 on1:
 	*dupentry = false;
 	cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
-	for (bit = (cp - (const u_char *)key) << 3; cmp_res; bit--)
+	for (bit = (unsigned int)(cp - (const u_char *)key) << 3;
+	     cmp_res; bit--)
 		cmp_res >>= 1;
     }
     {
@@ -561,10 +571,10 @@ rn_addmask(const void *_mask, bool search, int skip,
 	if (mlen <= skip)
 		return (maskhead->rnh_nodes); /* all-zero key */
 
-	bzero(addmask_key, sizeof(addmask_key));
+	memset(addmask_key, 0, sizeof(addmask_key));
 	if (skip > 1)
-		bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
-	bcopy(mask + skip, addmask_key + skip, mlen - skip);
+		memcpy(addmask_key + 1, rn_ones + 1, (size_t)(skip - 1));
+	memcpy(addmask_key + skip, mask + skip, (size_t)(mlen - skip));
 	/* Trim trailing zeroes. */
 	for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
 		cp--;
@@ -572,13 +582,13 @@ rn_addmask(const void *_mask, bool search, int skip,
 	if (mlen <= skip)
 		return (maskhead->rnh_nodes); /* all-zero key */
 
-	*addmask_key = mlen;
+	*addmask_key = (u_char)mlen;
 	x = rn_search(addmask_key, maskhead->rnh_treetop);
 	if (x->rn_key == NULL) {
 		kprintf("WARNING: radix_node->rn_key is NULL rn=%p\n", x);
 		print_backtrace(-1);
 		x = NULL;
-	} else if (bcmp(addmask_key, x->rn_key, mlen) != 0) {
+	} else if (memcmp(addmask_key, x->rn_key, (size_t)mlen) != 0) {
 		x = NULL;
 	}
 	if (x != NULL || search)
@@ -588,9 +598,9 @@ rn_addmask(const void *_mask, bool search, int skip,
 	if ((saved_x = x) == NULL)
 		return (NULL);
 
-	bzero(x, RN_MAXKEYLEN + 2 * (sizeof *x));
+	memset(x, 0, RN_MAXKEYLEN + 2 * (sizeof *x));
 	mask = p = (u_char *)(x + 2);
-	bcopy(addmask_key, p, mlen);
+	memcpy(p, addmask_key, (size_t)mlen);
 	x = rn_insert(mask, maskhead, &maskduplicated, x);
 	if (maskduplicated) {
 		log(LOG_ERR, "%s: mask impossibly already in tree", __func__);
@@ -624,7 +634,7 @@ rn_addmask(const void *_mask, bool search, int skip,
 		if (cp != (cplim - 1) || *cp != normal_chars[bit])
 			isnormal = false;
 	}
-	bit += (cp - mask) << 3;
+	bit += (int)((cp - mask) << 3);
 	x->rn_bit = -1 - bit;
 	if (isnormal)
 		x->rn_flags |= RNF_NORMAL;
@@ -671,7 +681,7 @@ rn_new_radix_mask(struct radix_node *node, struct radix_mask *nextmask)
 		return (NULL);
 	}
 
-	bzero(m, sizeof(*m));
+	memset(m, 0, sizeof(*m));
 	m->rm_bit = node->rn_bit;
 	m->rm_flags = node->rn_flags;
 	if (m->rm_flags & RNF_NORMAL)
@@ -885,8 +895,8 @@ rn_delete(const void *key, const void *mask, struct radix_node_head *head)
 	saved_tt = tt;
 	top = x;
 	if (tt == NULL ||
-	    bcmp((const u_char *)key + head_off, tt->rn_key + head_off,
-		 klen - head_off) != 0)
+	    memcmp((const u_char *)key + head_off, tt->rn_key + head_off,
+		   (size_t)(klen - head_off)) != 0)
 		return (NULL);
 
 	/*
@@ -1254,10 +1264,11 @@ rn_inithead(struct radix_node_head **head, struct radix_node_head *maskhead,
 	if (off_bytes >= RN_MAXKEYLEN)	/* prevent possible misuse */
 		panic("%s: invalid off_bytes=%d", __func__, off_bytes);
 
-	bzero(rnh, sizeof *rnh);
+	memset(rnh, 0, sizeof *rnh);
 	*head = rnh;
 
-	root = rn_newpair(rn_zeros, off_bytes * NBBY, rnh->rnh_nodes);
+	root = rn_newpair(rn_zeros, (unsigned int)(off_bytes * NBBY),
+			  rnh->rnh_nodes);
 	right = &rnh->rnh_nodes[2];
 	root->rn_parent = root;
 	root->rn_flags = RNF_ROOT | RNF_ACTIVE;
diff --git a/sys/net/radix.h b/sys/net/radix.h
index ca70cb8b11e..8c23f5f9139 100644
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -44,9 +44,9 @@ struct radix_node {
 	struct	radix_node *rn_parent;	/* parent */
 	int	rn_bit;		/* node: bit offset; leaf: -1-index(netmask) */
 	u_char	rn_flags;	/* enumerated next */
-#define RNF_NORMAL	1	/* leaf contains normal route */
-#define RNF_ROOT	2	/* leaf is root node (embedded in the tree) */
-#define RNF_ACTIVE	4	/* node is alive (for rtfree) */
+#define RNF_NORMAL	0x1	/* leaf contains normal route */
+#define RNF_ROOT	0x2	/* leaf is root node (embedded in the tree) */
+#define RNF_ACTIVE	0x4	/* node is alive (for rtfree) */
 	union {
 		/* leaf-only data: */
 		struct {
@@ -83,16 +83,7 @@ struct radix_node {
 #define	rn_left		rn_u.rn_node.rn_Left
 #define	rn_right	rn_u.rn_node.rn_Right
 
-/*
- * We do this statically now because the dynamic initialization
- * occurs too late and has an ordering problem w/ pf preloads
- * vs protocol domains.
- */
 #define RN_MAXKEYLEN	32
-#define RN_MAXKEYONES	{ -1, -1, -1, -1, -1, -1, -1, -1,	\
-			  -1, -1, -1, -1, -1, -1, -1, -1,	\
-			  -1, -1, -1, -1, -1, -1, -1, -1,	\
-			  -1, -1, -1, -1, -1, -1, -1, -1 }
 
 /*
  * Annotations to tree concerning potential routes applying to subtrees.
