Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 remove unused
details: https://anonhg.NetBSD.org/src/rev/0647fd8de4c2
branches: trunk
changeset: 934697:0647fd8de4c2
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Jun 16 17:12:18 2020 +0000
description:
remove unused
diffstat:
sys/netinet6/in6.c | 30 +------------
sys/netinet6/in6_var.h | 3 +-
sys/netinet6/scope6.c | 107 +---------------------------------------------
sys/netinet6/scope6_var.h | 4 -
4 files changed, 5 insertions(+), 139 deletions(-)
diffs (217 lines):
diff -r 389454864547 -r 0647fd8de4c2 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Tue Jun 16 14:45:08 2020 +0000
+++ b/sys/netinet6/in6.c Tue Jun 16 17:12:18 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.280 2020/06/14 14:26:17 roy Exp $ */
+/* $NetBSD: in6.c,v 1.281 2020/06/16 17:12:18 maxv Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.280 2020/06/14 14:26:17 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.281 2020/06/16 17:12:18 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2000,32 +2000,6 @@
return match;
}
-/* XXX: to be scope conscious */
-int
-in6_are_prefix_equal(struct in6_addr *p1, struct in6_addr *p2, int len)
-{
- int bytelen, bitlen;
-
- /* sanity check */
- if (len < 0 || len > 128) {
- log(LOG_ERR, "in6_are_prefix_equal: invalid prefix length(%d)\n",
- len);
- return 0;
- }
-
- bytelen = len / NBBY;
- bitlen = len % NBBY;
-
- if (memcmp(&p1->s6_addr, &p2->s6_addr, bytelen))
- return 0;
- if (bitlen != 0 &&
- p1->s6_addr[bytelen] >> (NBBY - bitlen) !=
- p2->s6_addr[bytelen] >> (NBBY - bitlen))
- return 0;
-
- return 1;
-}
-
void
in6_prefixlen2mask(struct in6_addr *maskp, int len)
{
diff -r 389454864547 -r 0647fd8de4c2 sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h Tue Jun 16 14:45:08 2020 +0000
+++ b/sys/netinet6/in6_var.h Tue Jun 16 17:12:18 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_var.h,v 1.103 2020/06/12 11:04:45 roy Exp $ */
+/* $NetBSD: in6_var.h,v 1.104 2020/06/16 17:12:18 maxv Exp $ */
/* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */
/*
@@ -624,7 +624,6 @@
struct psref *);
struct in6_ifaddr *in6ifa_ifwithaddr(const struct in6_addr *, uint32_t);
int in6_matchlen(struct in6_addr *, struct in6_addr *);
-int in6_are_prefix_equal(struct in6_addr *, struct in6_addr *, int);
void in6_prefixlen2mask(struct in6_addr *, int);
void in6_purge_mcast_references(struct in6_multi *);
diff -r 389454864547 -r 0647fd8de4c2 sys/netinet6/scope6.c
--- a/sys/netinet6/scope6.c Tue Jun 16 14:45:08 2020 +0000
+++ b/sys/netinet6/scope6.c Tue Jun 16 17:12:18 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scope6.c,v 1.22 2019/09/23 23:12:47 kamil Exp $ */
+/* $NetBSD: scope6.c,v 1.23 2020/06/16 17:12:18 maxv Exp $ */
/* $KAME$ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.22 2019/09/23 23:12:47 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.23 2020/06/16 17:12:18 maxv Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@@ -95,78 +95,6 @@
free(sid, M_IFADDR);
}
-int
-scope6_set(struct ifnet *ifp, const struct scope6_id *idlist)
-{
- int i;
- int error = 0;
- struct scope6_id *sid = SID(ifp);
-
- if (!sid) /* paranoid? */
- return EINVAL;
-
- /*
- * XXX: We need more consistency checks of the relationship among
- * scopes (e.g. an organization should be larger than a site).
- */
-
- /*
- * TODO(XXX): after setting, we should reflect the changes to
- * interface addresses, routing table entries, PCB entries...
- */
-
- for (i = 0; i < 16; i++) {
- if (idlist->s6id_list[i] &&
- idlist->s6id_list[i] != sid->s6id_list[i]) {
- int s;
- /*
- * An interface zone ID must be the corresponding
- * interface index by definition.
- */
- if (i == IPV6_ADDR_SCOPE_INTFACELOCAL &&
- idlist->s6id_list[i] != ifp->if_index)
- return EINVAL;
-
- s = pserialize_read_enter();
- if (i == IPV6_ADDR_SCOPE_LINKLOCAL &&
- !if_byindex(idlist->s6id_list[i])) {
- /*
- * XXX: theoretically, there should be no
- * relationship between link IDs and interface
- * IDs, but we check the consistency for
- * safety in later use.
- */
- pserialize_read_exit(s);
- return EINVAL;
- }
- pserialize_read_exit(s);
-
- /*
- * XXX: we must need lots of work in this case,
- * but we simply set the new value in this initial
- * implementation.
- */
- sid->s6id_list[i] = idlist->s6id_list[i];
- }
- }
-
- return error;
-}
-
-int
-scope6_get(const struct ifnet *ifp, struct scope6_id *idlist)
-{
- /* We only need to lock the interface's afdata for SID() to work. */
- const struct scope6_id *sid = SID(ifp);
-
- if (sid == NULL) /* paranoid? */
- return EINVAL;
-
- *idlist = *sid;
-
- return 0;
-}
-
/*
* Get a scope of the address. Interface-local, link-local, site-local
* or global.
@@ -224,37 +152,6 @@
return IPV6_ADDR_SCOPE_GLOBAL;
}
-/* note that ifp argument might be NULL */
-void
-scope6_setdefault(struct ifnet *ifp)
-{
-
- /*
- * Currently, this function just sets the default "interfaces"
- * and "links" according to the given interface.
- * We might eventually have to separate the notion of "link" from
- * "interface" and provide a user interface to set the default.
- */
- if (ifp) {
- sid_default.s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] =
- ifp->if_index;
- sid_default.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] =
- ifp->if_index;
- } else {
- sid_default.s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] = 0;
- sid_default.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] = 0;
- }
-}
-
-int
-scope6_get_default(struct scope6_id *idlist)
-{
-
- *idlist = sid_default;
-
- return 0;
-}
-
uint32_t
scope6_addr2default(const struct in6_addr *addr)
{
diff -r 389454864547 -r 0647fd8de4c2 sys/netinet6/scope6_var.h
--- a/sys/netinet6/scope6_var.h Tue Jun 16 14:45:08 2020 +0000
+++ b/sys/netinet6/scope6_var.h Tue Jun 16 17:12:18 2020 +0000
@@ -105,10 +105,6 @@
void scope6_init(void);
struct scope6_id *scope6_ifattach(struct ifnet *);
void scope6_ifdetach(struct scope6_id *);
-int scope6_set(struct ifnet *, const struct scope6_id *);
-int scope6_get(const struct ifnet *, struct scope6_id *);
-void scope6_setdefault(struct ifnet *);
-int scope6_get_default(struct scope6_id *);
uint32_t scope6_in6_addrscope(struct in6_addr *);
uint32_t scope6_addr2default(const struct in6_addr *);
int sa6_embedscope(struct sockaddr_in6 *, int);
Home |
Main Index |
Thread Index |
Old Index