Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys unifdef OLDIP6OUTPUT
details: https://anonhg.NetBSD.org/src/rev/10d5518e14c6
branches: trunk
changeset: 516140:10d5518e14c6
user: itojun <itojun%NetBSD.org@localhost>
date: Wed Oct 17 08:23:05 2001 +0000
description:
unifdef OLDIP6OUTPUT
diffstat:
sys/net/if_arcsubr.c | 7 +--
sys/net/if_ethersubr.c | 7 +--
sys/net/if_fddisubr.c | 7 +--
sys/netinet6/ip6_forward.c | 8 +--
sys/netinet6/ip6_output.c | 13 +-----
sys/netinet6/nd6.c | 107 +--------------------------------------------
sys/netinet6/nd6_nbr.c | 6 +--
7 files changed, 7 insertions(+), 148 deletions(-)
diffs (293 lines):
diff -r 5c712c17583c -r 10d5518e14c6 sys/net/if_arcsubr.c
--- a/sys/net/if_arcsubr.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/net/if_arcsubr.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_arcsubr.c,v 1.36 2001/06/14 05:44:23 itojun Exp $ */
+/* $NetBSD: if_arcsubr.c,v 1.37 2001/10/17 08:23:05 itojun Exp $ */
/*
* Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -237,13 +237,8 @@
#endif
#ifdef INET6
case AF_INET6:
-#ifdef OLDIP6OUTPUT
- if (!nd6_resolve(ifp, rt, m, dst, (u_char *)&adst))
- return(0); /* if not yet resolves */
-#else
if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)&adst))
return(0); /* it must be impossible, but... */
-#endif /* OLDIP6OUTPUT */
atype = htons(ARCTYPE_INET6);
newencoding = 1;
break;
diff -r 5c712c17583c -r 10d5518e14c6 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/net/if_ethersubr.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.88 2001/07/25 03:18:46 thorpej Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.89 2001/10/17 08:23:05 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -283,15 +283,10 @@
#endif
#ifdef INET6
case AF_INET6:
-#ifdef OLDIP6OUTPUT
- if (!nd6_resolve(ifp, rt, m, dst, (u_char *)edst))
- return(0); /* if not yet resolves */
-#else
if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst)){
/* something bad happened */
return(0);
}
-#endif /* OLDIP6OUTPUT */
etype = htons(ETHERTYPE_IPV6);
break;
#endif
diff -r 5c712c17583c -r 10d5518e14c6 sys/net/if_fddisubr.c
--- a/sys/net/if_fddisubr.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/net/if_fddisubr.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fddisubr.c,v 1.41 2001/07/24 06:29:13 matt Exp $ */
+/* $NetBSD: if_fddisubr.c,v 1.42 2001/10/17 08:23:06 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -286,15 +286,10 @@
#endif
#ifdef INET6
case AF_INET6:
-#ifdef OLDIP6OUTPUT
- if (!nd6_resolve(ifp, rt, m, dst, edst))
- return (0); /* if not yet resolved */
-#else
if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst)){
/* something bad happened */
return(0);
}
-#endif /* OLDIP6OUTPUT */
etype = htons(ETHERTYPE_IPV6);
break;
#endif
diff -r 5c712c17583c -r 10d5518e14c6 sys/netinet6/ip6_forward.c
--- a/sys/netinet6/ip6_forward.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/netinet6/ip6_forward.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_forward.c,v 1.23 2001/07/18 09:24:26 itojun Exp $ */
+/* $NetBSD: ip6_forward.c,v 1.24 2001/10/17 08:23:06 itojun Exp $ */
/* $KAME: ip6_forward.c,v 1.74 2001/06/12 23:54:55 itojun Exp $ */
/*
@@ -503,13 +503,7 @@
ip6 = mtod(m, struct ip6_hdr *);
#endif /* PFIL_HOOKS */
-#ifdef OLDIP6OUTPUT
- error = (*rt->rt_ifp->if_output)(rt->rt_ifp, m,
- (struct sockaddr *)dst,
- ip6_forward_rt.ro_rt);
-#else
error = nd6_output(rt->rt_ifp, origifp, m, dst, rt);
-#endif
if (error) {
in6_ifstat_inc(rt->rt_ifp, ifs6_out_discard);
ip6stat.ip6s_cantforward++;
diff -r 5c712c17583c -r 10d5518e14c6 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/netinet6/ip6_output.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_output.c,v 1.37 2001/10/15 09:51:17 itojun Exp $ */
+/* $NetBSD: ip6_output.c,v 1.38 2001/10/17 08:23:06 itojun Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -870,12 +870,7 @@
/* clean ipsec history once it goes out of the node */
ipsec_delaux(m);
#endif
-#ifdef OLDIP6OUTPUT
- error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
- ro->ro_rt);
-#else
error = nd6_output(ifp, origifp, m, dst, ro->ro_rt);
-#endif
goto done;
} else if (mtu < IPV6_MMTU) {
/*
@@ -1004,13 +999,7 @@
/* clean ipsec history once it goes out of the node */
ipsec_delaux(m);
#endif
-#ifdef OLDIP6OUTPUT
- error = (*ifp->if_output)(ifp, m,
- (struct sockaddr *)dst,
- ro->ro_rt);
-#else
error = nd6_output(ifp, origifp, m, dst, ro->ro_rt);
-#endif
} else
m_freem(m);
}
diff -r 5c712c17583c -r 10d5518e14c6 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/netinet6/nd6.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6.c,v 1.52 2001/10/16 06:24:45 itojun Exp $ */
+/* $NetBSD: nd6.c,v 1.53 2001/10/17 08:23:07 itojun Exp $ */
/* $KAME: nd6.c,v 1.151 2001/06/19 14:24:41 sumikawa Exp $ */
/*
@@ -943,103 +943,6 @@
nd_ifinfo[rt->rt_ifp->if_index].reachable;
}
-#ifdef OLDIP6OUTPUT
-/*
- * Resolve an IP6 address into an ethernet address. If success,
- * desten is filled in. If there is no entry in ndptab,
- * set one up and multicast a solicitation for the IP6 address.
- * Hold onto this mbuf and resend it once the address
- * is finally resolved. A return value of 1 indicates
- * that desten has been filled in and the packet should be sent
- * normally; a 0 return indicates that the packet has been
- * taken over here, either now or for later transmission.
- */
-int
-nd6_resolve(ifp, rt, m, dst, desten)
- struct ifnet *ifp;
- struct rtentry *rt;
- struct mbuf *m;
- struct sockaddr *dst;
- u_char *desten;
-{
- struct llinfo_nd6 *ln = (struct llinfo_nd6 *)NULL;
- struct sockaddr_dl *sdl;
- long time_second = time.tv_sec;
-
- if (m->m_flags & M_MCAST) {
- switch (ifp->if_type) {
- case IFT_ETHER:
- case IFT_FDDI:
- ETHER_MAP_IPV6_MULTICAST(&SIN6(dst)->sin6_addr,
- desten);
- return(1);
- case IFT_IEEE1394:
- bcopy(ifp->if_broadcastaddr, desten, ifp->if_addrlen);
- return(1);
- case IFT_ARCNET:
- *desten = 0;
- return(1);
- default:
- m_freem(m);
- return(0);
- }
- }
- if (rt && (rt->rt_flags & RTF_LLINFO) != 0)
- ln = (struct llinfo_nd6 *)rt->rt_llinfo;
- else {
- if ((rt = nd6_lookup(&(SIN6(dst)->sin6_addr), 1, ifp)) != NULL)
- ln = (struct llinfo_nd6 *)rt->rt_llinfo;
- }
- if (!ln || !rt) {
- log(LOG_DEBUG, "nd6_resolve: can't allocate llinfo for %s\n",
- ip6_sprintf(&(SIN6(dst)->sin6_addr)));
- m_freem(m);
- return(0);
- }
- sdl = SDL(rt->rt_gateway);
- /*
- * Ckeck the address family and length is valid, the address
- * is resolved; otherwise, try to resolve.
- */
- if (ln->ln_state >= ND6_LLINFO_REACHABLE
- && sdl->sdl_family == AF_LINK
- && sdl->sdl_alen != 0) {
- bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
- if (ln->ln_state == ND6_LLINFO_STALE) {
- ln->ln_asked = 0;
- ln->ln_state = ND6_LLINFO_DELAY;
- ln->ln_expire = time_second + nd6_delay;
- }
- return(1);
- }
- /*
- * There is an ndp entry, but no ethernet address
- * response yet. Replace the held mbuf with this
- * latest one.
- *
- * XXX Does the code conform to rate-limiting rule?
- * (RFC 2461 7.2.2)
- */
- if (ln->ln_state == ND6_LLINFO_NOSTATE)
- ln->ln_state = ND6_LLINFO_INCOMPLETE;
- if (ln->ln_hold)
- m_freem(ln->ln_hold);
- ln->ln_hold = m;
- if (ln->ln_expire) {
- if (ln->ln_asked < nd6_mmaxtries &&
- ln->ln_expire < time_second) {
- ln->ln_asked++;
- ln->ln_expire = time_second +
- nd_ifinfo[ifp->if_index].retrans / 1000;
- nd6_ns_output(ifp, NULL, &(SIN6(dst)->sin6_addr),
- ln, 0);
- }
- }
- /* do not free mbuf here, it is queued into llinfo_nd6 */
- return(0);
-}
-#endif /* OLDIP6OUTPUT */
-
void
nd6_rtrequest(req, rt, info)
int req;
@@ -1673,13 +1576,6 @@
ln->ln_expire = time_second + nd6_gctimer;
if (ln->ln_hold) {
-#ifdef OLDIP6OUTPUT
- ln->ln_asked = 0;
- ln->ln_state = ND6_LLINFO_DELAY;
- ln->ln_expire = time_second + nd6_delay;
- (*ifp->if_output)(ifp, ln->ln_hold,
- rt_key(rt), rt);
-#else
/*
* we assume ifp is not a p2p here, so just
* set the 2nd argument as the 1st one.
@@ -1687,7 +1583,6 @@
nd6_output(ifp, ifp, ln->ln_hold,
(struct sockaddr_in6 *)rt_key(rt),
rt);
-#endif
ln->ln_hold = NULL;
}
} else if (ln->ln_state == ND6_LLINFO_INCOMPLETE) {
diff -r 5c712c17583c -r 10d5518e14c6 sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c Wed Oct 17 07:38:48 2001 +0000
+++ b/sys/netinet6/nd6_nbr.c Wed Oct 17 08:23:05 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6_nbr.c,v 1.29 2001/10/16 06:24:45 itojun Exp $ */
+/* $NetBSD: nd6_nbr.c,v 1.30 2001/10/17 08:23:07 itojun Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -785,16 +785,12 @@
rt->rt_flags &= ~RTF_REJECT;
ln->ln_asked = 0;
if (ln->ln_hold) {
-#ifdef OLDIP6OUTPUT
- (*ifp->if_output)(ifp, ln->ln_hold, rt_key(rt), rt);
-#else
/*
* we assume ifp is not a p2p here, so just set the 2nd
* argument as the 1st one.
*/
nd6_output(ifp, ifp, ln->ln_hold,
(struct sockaddr_in6 *)rt_key(rt), rt);
-#endif
ln->ln_hold = 0;
}
Home |
Main Index |
Thread Index |
Old Index