summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-07-08 19:42:47 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-07-08 19:42:47 +0000
commit81e7dec44837a6821816c4a2fc34a463219a91ca (patch)
tree9e7dff2fc4b77980c39f4c2593b14eddf00e3e78 /sys
parent7524ee837cf2d945ff4fbee9639a0992db5150e3 (diff)
remove some unused netinet6 code
ok stsp@ henning@ claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/in6.c118
-rw-r--r--sys/netinet6/in6.h4
-rw-r--r--sys/netinet6/in6_proto.c9
-rw-r--r--sys/netinet6/in6_var.h4
-rw-r--r--sys/netinet6/ip6_input.c6
-rw-r--r--sys/netinet6/ip6_output.c25
-rw-r--r--sys/netinet6/ip6_var.h6
7 files changed, 7 insertions, 165 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 08fb95b9bab..30344bac8d7 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.87 2010/05/08 10:55:06 stsp Exp $ */
+/* $OpenBSD: in6.c,v 1.88 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -104,8 +104,6 @@ const struct in6_addr in6addr_intfacelocal_allnodes =
IN6ADDR_INTFACELOCAL_ALLNODES_INIT;
const struct in6_addr in6addr_linklocal_allnodes =
IN6ADDR_LINKLOCAL_ALLNODES_INIT;
-const struct in6_addr in6addr_linklocal_allrouters =
- IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
const struct in6_addr in6mask0 = IN6MASK0;
const struct in6_addr in6mask32 = IN6MASK32;
@@ -1326,22 +1324,6 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
splx(s);
}
-void
-in6_purgeif(struct ifnet *ifp)
-{
- struct ifaddr *ifa, *nifa;
-
- for (ifa = TAILQ_FIRST(&ifp->if_addrlist); ifa != NULL; ifa = nifa)
- {
- nifa = TAILQ_NEXT(ifa, ifa_list);
- if (ifa->ifa_addr->sa_family != AF_INET6)
- continue;
- in6_purgeaddr(ifa);
- }
-
- in6_ifdetach(ifp);
-}
-
/*
* SIOC[GAD]LIFADDR.
* SIOCGLIFADDR: get first address. (?)
@@ -2110,23 +2092,6 @@ in6_addr2scopeid(struct ifnet *ifp, struct in6_addr *addr)
}
}
-int
-in6_is_addr_deprecated(struct sockaddr_in6 *sa6)
-{
- struct in6_ifaddr *ia;
-
- for (ia = in6_ifaddr; ia; ia = ia->ia_next) {
- if (IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr,
- &sa6->sin6_addr) &&
- (ia->ia6_flags & IN6_IFF_DEPRECATED) != 0)
- return (1); /* true */
-
- /* XXX: do we still have to go thru the rest of the list? */
- }
-
- return (0); /* false */
-}
-
/*
* return length of part which dst and src are equal
* hard coding...
@@ -2461,87 +2426,6 @@ in6_ifawithscope(struct ifnet *oifp, struct in6_addr *dst)
}
/*
- * return the best address out of the same scope. if no address was
- * found, return the first valid address from designated IF.
- */
-struct in6_ifaddr *
-in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
-{
- int dst_scope = in6_addrscope(dst), blen = -1, tlen;
- struct ifaddr *ifa;
- struct in6_ifaddr *besta = 0;
- struct in6_ifaddr *dep[2]; /*last-resort: deprecated*/
-
- dep[0] = dep[1] = NULL;
-
- /*
- * We first look for addresses in the same scope.
- * If there is one, return it.
- * If two or more, return one which matches the dst longest.
- * If none, return one of global addresses assigned other ifs.
- */
- TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
- if (ifa->ifa_addr->sa_family != AF_INET6)
- continue;
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
- continue; /* XXX: is there any case to allow anycast? */
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_NOTREADY)
- continue; /* don't use this interface */
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DETACHED)
- continue;
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DEPRECATED) {
- if (ip6_use_deprecated)
- dep[0] = (struct in6_ifaddr *)ifa;
- continue;
- }
-
- if (dst_scope == in6_addrscope(IFA_IN6(ifa))) {
- /*
- * call in6_matchlen() as few as possible
- */
- if (besta) {
- if (blen == -1)
- blen = in6_matchlen(&besta->ia_addr.sin6_addr, dst);
- tlen = in6_matchlen(IFA_IN6(ifa), dst);
- if (tlen > blen) {
- blen = tlen;
- besta = (struct in6_ifaddr *)ifa;
- }
- } else
- besta = (struct in6_ifaddr *)ifa;
- }
- }
- if (besta)
- return (besta);
-
- TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
- if (ifa->ifa_addr->sa_family != AF_INET6)
- continue;
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
- continue; /* XXX: is there any case to allow anycast? */
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_NOTREADY)
- continue; /* don't use this interface */
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DETACHED)
- continue;
- if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DEPRECATED) {
- if (ip6_use_deprecated)
- dep[1] = (struct in6_ifaddr *)ifa;
- continue;
- }
-
- return (struct in6_ifaddr *)ifa;
- }
-
- /* use the last-resort values, that are, deprecated addresses */
- if (dep[0])
- return dep[0];
- if (dep[1])
- return dep[1];
-
- return NULL;
-}
-
-/*
* perform DAD when interface becomes IFF_UP.
*/
void
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 7e2d1fbcab2..e70268deed1 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.50 2010/05/07 13:33:17 claudio Exp $ */
+/* $OpenBSD: in6.h,v 1.51 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -224,7 +224,6 @@ extern const struct in6_addr in6addr_loopback;
#if __BSD_VISIBLE
extern const struct in6_addr in6addr_intfacelocal_allnodes;
extern const struct in6_addr in6addr_linklocal_allnodes;
-extern const struct in6_addr in6addr_linklocal_allrouters;
#endif
/*
@@ -783,7 +782,6 @@ int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t);
int in6_localaddr(struct in6_addr *);
int in6_addrscope(struct in6_addr *);
struct in6_ifaddr *in6_ifawithscope(struct ifnet *, struct in6_addr *);
-struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *);
extern void in6_if_up(struct ifnet *);
void in6_get_rand_ifid(struct ifnet *, struct in6_addr *);
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index c575bae7279..11c29783988 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_proto.c,v 1.58 2009/11/05 20:50:14 michele Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.59 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -288,7 +288,6 @@ int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */
int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */
int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */
int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */
-u_int32_t ip6_id = 0UL;
int ip6_keepfaith = 0;
time_t ip6_log_time = (time_t)0L;
@@ -313,11 +312,5 @@ u_long rip6_recvspace = RIPV6RCVQ;
/* ICMPV6 parameters */
int icmp6_rediraccept = 1; /* accept and process redirects */
int icmp6_redirtimeout = 10 * 60; /* 10 minutes */
-struct timeval icmp6errratelim = { 0, 0 }; /* no ratelimit */
int icmp6errppslim = 100; /* 100pps */
int icmp6_nodeinfo = 1; /* enable/disable NI response */
-
-/* UDP on IP6 parameters */
-int udp6_sendspace = 9216; /* really max datagram size */
-int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
- /* 40 1K datagrams */
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
index 82df23171d4..27efbf397b6 100644
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_var.h,v 1.31 2010/04/06 14:12:10 stsp Exp $ */
+/* $OpenBSD: in6_var.h,v 1.32 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */
/*
@@ -579,7 +579,6 @@ int in6_update_ifa(struct ifnet *, struct in6_aliasreq *,
struct in6_ifaddr *);
void in6_purgeaddr(struct ifaddr *);
int in6if_do_dad(struct ifnet *);
-void in6_purgeif(struct ifnet *);
void in6_savemkludge(struct in6_ifaddr *);
void in6_setmaxmtu(void);
void *in6_domifattach(struct ifnet *);
@@ -600,7 +599,6 @@ void in6_purgeprefix(struct ifnet *);
void in6_ifaddloop(struct ifaddr *);
void in6_ifremloop(struct ifaddr *);
-int in6_is_addr_deprecated(struct sockaddr_in6 *);
struct inpcb;
int in6_embedscope(struct in6_addr *, const struct sockaddr_in6 *,
struct inpcb *, struct ifnet **);
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 0d144a78f3f..a1abc6fc591 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.96 2010/05/07 13:33:17 claudio Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.97 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -127,10 +127,6 @@ static int ip6qmaxlen = IFQ_MAXLEN;
struct in6_ifaddr *in6_ifaddr;
struct ifqueue ip6intrq;
-int ip6_forward_srcrt; /* XXX */
-int ip6_sourcecheck; /* XXX */
-int ip6_sourcecheck_interval; /* XXX */
-
struct ip6stat ip6stat;
void ip6_init2(void *);
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index fd1c1b1eca8..4e993ffc8d0 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.114 2010/07/01 02:09:45 reyk Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.115 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -3167,29 +3167,6 @@ ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs)
return 0;
}
-/*
- * Compute IPv6 extension header length.
- */
-int
-ip6_optlen(struct inpcb *inp)
-{
- int len;
-
- if (!inp->inp_outputopts6)
- return 0;
-
- len = 0;
-#define elen(x) \
- (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))->ip6e_len + 1) << 3 : 0)
-
- len += elen(inp->inp_outputopts6->ip6po_hbh);
- len += elen(inp->inp_outputopts6->ip6po_dest1);
- len += elen(inp->inp_outputopts6->ip6po_rthdr);
- len += elen(inp->inp_outputopts6->ip6po_dest2);
- return len;
-#undef elen
-}
-
u_int32_t
ip6_randomid(void)
{
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 96881a7a0e6..c08de1d50f5 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_var.h,v 1.36 2008/11/25 12:11:45 markus Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.37 2010/07/08 19:42:46 jsg Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
@@ -241,7 +241,6 @@ extern int ip6_forwarding; /* act as router? */
extern int ip6_mforwarding; /* act as multicast router? */
extern int ip6_multipath; /* use multipath routes */
extern int ip6_sendredirect; /* send ICMPv6 redirect? */
-extern int ip6_forward_srcrt; /* forward src-routed? */
extern int ip6_use_deprecated; /* allow deprecated addr as source */
extern int ip6_rr_prune; /* router renumbering prefix
* walk list every 5 sec. */
@@ -256,8 +255,6 @@ extern struct socket *ip6_mrouter; /* multicast routing daemon */
extern int ip6_sendredirects; /* send IP redirects when forwarding? */
extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */
extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */
-extern int ip6_sourcecheck; /* Verify source interface */
-extern int ip6_sourcecheck_interval; /* Interval between log messages */
extern int ip6_accept_rtadv; /* Acts as a host not a router */
extern int ip6_keepfaith; /* Firewall Aided Internet Translator */
extern int ip6_log_interval;
@@ -300,7 +297,6 @@ void ip6_initpktopts(struct ip6_pktopts *);
int ip6_setpktopts(struct mbuf *, struct ip6_pktopts *,
struct ip6_pktopts *, int, int);
void ip6_clearpktopts(struct ip6_pktopts *, int);
-int ip6_optlen(struct inpcb *);
void ip6_randomid_init(void);
u_int32_t ip6_randomid(void);