Remove in6_prefix.[ch] and the contained router renumbering capability.
The prefix management code currently resides in nd6, leaving only the unused router renumbering capability in the in6_prefix files. Removing it will make it easier for us to provide locking for the remainder of IPv6 by reducing the number of objects requiring synchronized access. This functionality has also been removed from NetBSD and OpenBSD. Submitted by: George Neville-Neil <gnn at neville-neil.com> Discussed with/approved by: suz, keiichi at kame.net, core at kame.net
This commit is contained in:
parent
edf5a7b07f
commit
b1d9338b73
@ -1517,7 +1517,6 @@ netinet6/in6_cksum.c optional inet6
|
||||
netinet6/in6_gif.c optional gif inet6
|
||||
netinet6/in6_ifattach.c optional inet6
|
||||
netinet6/in6_pcb.c optional inet6
|
||||
netinet6/in6_prefix.c optional inet6
|
||||
netinet6/in6_proto.c optional inet6
|
||||
netinet6/in6_rmx.c optional inet6
|
||||
netinet6/in6_src.c optional inet6
|
||||
|
@ -1151,7 +1151,6 @@ in6_unlink_ifa(ia, ifp)
|
||||
struct in6_ifaddr *ia;
|
||||
struct ifnet *ifp;
|
||||
{
|
||||
int plen, iilen;
|
||||
struct in6_ifaddr *oia;
|
||||
int s = splnet();
|
||||
|
||||
@ -1171,12 +1170,6 @@ in6_unlink_ifa(ia, ifp)
|
||||
}
|
||||
}
|
||||
|
||||
if (oia->ia6_ifpr) { /* check for safety */
|
||||
plen = in6_mask2len(&oia->ia_prefixmask.sin6_addr, NULL);
|
||||
iilen = (sizeof(oia->ia_prefixmask.sin6_addr) << 3) - plen;
|
||||
in6_prefix_remove_ifid(iilen, oia);
|
||||
}
|
||||
|
||||
/*
|
||||
* When an autoconfigured address is being removed, release the
|
||||
* reference to the base prefix. Also, since the release might
|
||||
|
@ -754,9 +754,6 @@ in6_ifdetach(ifp)
|
||||
struct in6_multi *in6m;
|
||||
struct in6_multi *in6m_next;
|
||||
|
||||
/* nuke prefix list. this may try to remove some of ifaddrs as well */
|
||||
in6_purgeprefix(ifp);
|
||||
|
||||
/* remove neighbor management table */
|
||||
nd6_purge(ifp);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,91 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: in6_prefix.h,v 1.10 2001/02/08 16:30:30 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, 1998 and 1999 WIDE Project.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/callout.h>
|
||||
|
||||
struct rr_prefix {
|
||||
struct ifprefix rp_ifpr;
|
||||
LIST_ENTRY(rr_prefix) rp_entry;
|
||||
LIST_HEAD(rp_addrhead, rp_addr) rp_addrhead;
|
||||
struct sockaddr_in6 rp_prefix; /* prefix */
|
||||
u_int32_t rp_vltime; /* advertised valid lifetime */
|
||||
u_int32_t rp_pltime; /* advertised preferred lifetime */
|
||||
time_t rp_expire; /* expiration time of the prefix */
|
||||
time_t rp_preferred; /* preferred time of the prefix */
|
||||
struct in6_prflags rp_flags;
|
||||
u_char rp_origin; /* from where this prefix info is obtained */
|
||||
struct rp_stateflags {
|
||||
/* if some prefix should be added to this prefix */
|
||||
u_char addmark : 1;
|
||||
u_char delmark : 1; /* if this prefix will be deleted */
|
||||
} rp_stateflags;
|
||||
};
|
||||
|
||||
#define rp_type rp_ifpr.ifpr_type
|
||||
#define rp_ifp rp_ifpr.ifpr_ifp
|
||||
#define rp_plen rp_ifpr.ifpr_plen
|
||||
|
||||
#define rp_raf rp_flags.prf_ra
|
||||
#define rp_raf_onlink rp_flags.prf_ra.onlink
|
||||
#define rp_raf_auto rp_flags.prf_ra.autonomous
|
||||
|
||||
#define rp_statef_addmark rp_stateflags.addmark
|
||||
#define rp_statef_delmark rp_stateflags.delmark
|
||||
|
||||
#define rp_rrf rp_flags.prf_rr
|
||||
#define rp_rrf_decrvalid rp_flags.prf_rr.decrvalid
|
||||
#define rp_rrf_decrprefd rp_flags.prf_rr.decrprefd
|
||||
|
||||
struct rp_addr {
|
||||
LIST_ENTRY(rp_addr) ra_entry;
|
||||
struct in6_addr ra_ifid;
|
||||
struct in6_ifaddr *ra_addr;
|
||||
struct ra_flags {
|
||||
u_char anycast : 1;
|
||||
} ra_flags;
|
||||
};
|
||||
|
||||
#define ifpr2rp(ifpr) ((struct rr_prefix *)(ifpr))
|
||||
#define rp2ifpr(rp) ((struct ifprefix *)(rp))
|
||||
|
||||
#define RP_IN6(rp) (&(rp)->rp_prefix.sin6_addr)
|
||||
|
||||
#define RR_INFINITE_LIFETIME 0xffffffff
|
||||
|
||||
|
||||
LIST_HEAD(rr_prhead, rr_prefix);
|
||||
|
||||
extern struct rr_prhead rr_prefix;
|
||||
|
||||
void in6_rr_timer __P((void *));
|
||||
extern struct callout in6_rr_timer_ch;
|
||||
int delete_each_prefix __P((struct rr_prefix *rpp, u_char origin));
|
@ -99,7 +99,6 @@
|
||||
#include <netinet6/udp6_var.h>
|
||||
#include <netinet6/pim6_var.h>
|
||||
#include <netinet6/nd6.h>
|
||||
#include <netinet6/in6_prefix.h>
|
||||
|
||||
#ifdef IPSEC
|
||||
#include <netinet6/ipsec.h>
|
||||
|
@ -104,7 +104,6 @@
|
||||
#include <netinet6/scope6_var.h>
|
||||
#include <netinet6/in6_ifattach.h>
|
||||
#include <netinet6/nd6.h>
|
||||
#include <netinet6/in6_prefix.h>
|
||||
|
||||
#ifdef IPSEC
|
||||
#include <netinet6/ipsec.h>
|
||||
@ -208,10 +207,6 @@ ip6_init2(dummy)
|
||||
callout_init(&nd6_timer_ch, 0);
|
||||
callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL);
|
||||
|
||||
/* router renumbering prefix list maintenance */
|
||||
callout_init(&in6_rr_timer_ch, 0);
|
||||
callout_reset(&in6_rr_timer_ch, hz, in6_rr_timer, NULL);
|
||||
|
||||
/* timer for regeneranation of temporary addresses randomize ID */
|
||||
callout_init(&in6_tmpaddrtimer_ch, 0);
|
||||
callout_reset(&in6_tmpaddrtimer_ch,
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include <netinet/ip6.h>
|
||||
#include <netinet6/ip6_var.h>
|
||||
#include <netinet6/nd6.h>
|
||||
#include <netinet6/in6_prefix.h>
|
||||
#include <netinet/icmp6.h>
|
||||
|
||||
#include <net/net_osdep.h>
|
||||
@ -1407,26 +1406,6 @@ nd6_ioctl(cmd, data, ifp)
|
||||
i++;
|
||||
pr = pr->ndpr_next;
|
||||
}
|
||||
{
|
||||
struct rr_prefix *rpp;
|
||||
|
||||
for (rpp = LIST_FIRST(&rr_prefix); rpp;
|
||||
rpp = LIST_NEXT(rpp, rp_entry)) {
|
||||
if (i >= PRLSTSIZ)
|
||||
break;
|
||||
(void)in6_embedscope(&oprl->prefix[i].prefix,
|
||||
&pr->ndpr_prefix, NULL, NULL);
|
||||
oprl->prefix[i].raflags = rpp->rp_raf;
|
||||
oprl->prefix[i].prefixlen = rpp->rp_plen;
|
||||
oprl->prefix[i].vltime = rpp->rp_vltime;
|
||||
oprl->prefix[i].pltime = rpp->rp_pltime;
|
||||
oprl->prefix[i].if_index = rpp->rp_ifp->if_index;
|
||||
oprl->prefix[i].expire = rpp->rp_expire;
|
||||
oprl->prefix[i].advrtrs = 0;
|
||||
oprl->prefix[i].origin = rpp->rp_origin;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
splx(s);
|
||||
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user