summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-08-15 06:08:53 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-08-15 06:08:53 +0000
commita8dab5358d2cc000a92a7660edb17d59e33574b4 (patch)
tree19c9028a1990bbe25b2623775eca5b90f5903f87 /sys/netinet6/in6.c
parent316f3a4f18276484bcf86647e4ae957935ff7914 (diff)
After we stopped processing router advertisements in the kernel
sppp_update_ip6_addr() became the last user of n6_are_prefix_equal(). Since it compares /128 prefixes it doesn't need all the bells and whistles and can be converted to a memcmp. Remove the now unused n6_are_prefix_equal(). OK bluhm, mpi
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index b83e6df6c66..a51374d8c11 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.210 2017/08/11 19:53:02 bluhm Exp $ */
+/* $OpenBSD: in6.c,v 1.211 2017/08/15 06:08:52 florian Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -1519,32 +1519,6 @@ in6_matchlen(struct in6_addr *src, struct in6_addr *dst)
return match;
}
-int
-in6_are_prefix_equal(struct in6_addr *p1, struct in6_addr *p2, int len)
-{
- int bytelen, bitlen;
-
- /* sanity check */
- if (0 > len || len > 128) {
- log(LOG_ERR, "in6_are_prefix_equal: invalid prefix length(%d)\n",
- len);
- return (0);
- }
-
- bytelen = len / 8;
- bitlen = len % 8;
-
- if (bcmp(&p1->s6_addr, &p2->s6_addr, bytelen))
- return (0);
- /* len == 128 is ok because bitlen == 0 then */
- if (bitlen != 0 &&
- p1->s6_addr[bytelen] >> (8 - bitlen) !=
- p2->s6_addr[bytelen] >> (8 - bitlen))
- return (0);
-
- return (1);
-}
-
void
in6_prefixlen2mask(struct in6_addr *maskp, int len)
{