diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-11-30 07:59:18 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-11-30 07:59:18 +0000 |
commit | d472bc02253ff3fddea9c03331b9a5e114f22f79 (patch) | |
tree | 5bb05bb9dce90f93812f0e116df8a876d319d364 | |
parent | 19af97d4ea8b7333876192a8643e598e1f191781 (diff) |
unifdef OLDIP6OUTPUT
-rw-r--r-- | sys/net/if_ethersubr.c | 7 | ||||
-rw-r--r-- | sys/net/if_fddisubr.c | 9 | ||||
-rw-r--r-- | sys/netinet6/ip6_forward.c | 8 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 13 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 105 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 6 |
6 files changed, 7 insertions, 141 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index c89d647fd23..60a0dcdcb26 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.58 2001/10/03 11:34:38 art Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.59 2001/11/30 07:59:17 itojun Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -301,13 +301,8 @@ ether_output(ifp, m0, dst, rt0) #endif #ifdef INET6 case AF_INET6: -#ifndef OLDIP6OUTPUT if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst)) return(0); /* it must be impossible, but... */ -#else - if (!nd6_resolve(ifp, rt, m, dst, (u_char *)edst)) - return(0); /* if not yet resolves */ -#endif etype = htons(ETHERTYPE_IPV6); break; #endif diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 3ae884a351c..f33507d23e8 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_fddisubr.c,v 1.25 2001/06/27 06:07:40 kjc Exp $ */ +/* $OpenBSD: if_fddisubr.c,v 1.26 2001/11/30 07:59:17 itojun Exp $ */ /* $NetBSD: if_fddisubr.c,v 1.5 1996/05/07 23:20:21 christos Exp $ */ /* @@ -205,13 +205,8 @@ fddi_output(ifp, m0, dst, rt0) #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)) - return 0; -#endif + return (0); /* if not yet resolved */ type = htons(ETHERTYPE_IPV6); break; #endif diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 8f98801e00c..ee64e4f054f 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.18 2001/11/26 16:50:26 jasoni Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.19 2001/11/30 07:59:17 itojun Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -497,13 +497,7 @@ ip6_forward(m, srcrt) ip6 = mtod(m, struct ip6_hdr *); #endif -#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 --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 226610de342..7f6fe7273d4 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.54 2001/11/28 10:48:13 itojun Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.55 2001/11/30 07:59:17 itojun Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -912,12 +912,7 @@ skip_ipsec2:; #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) { /* @@ -1033,13 +1028,7 @@ sendorfree: m0 = m->m_nextpkt; m->m_nextpkt = 0; if (error == 0) { -#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 --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 06110793d2a..bccf7fa48a4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.37 2001/06/29 16:10:36 itojun Exp $ */ +/* $OpenBSD: nd6.c,v 1.38 2001/11/30 07:59:17 itojun Exp $ */ /* $KAME: nd6.c,v 1.151 2001/06/19 14:24:41 sumikawa Exp $ */ /* @@ -931,101 +931,6 @@ nd6_nud_hint(rt, dst6, force) 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); - break; - 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; @@ -1659,13 +1564,6 @@ fail: 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. @@ -1673,7 +1571,6 @@ fail: 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 --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 8d6b0d8112e..2429cced007 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.17 2001/06/09 06:43:38 angelos Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.18 2001/11/30 07:59:17 itojun Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -768,16 +768,12 @@ nd6_na_input(m, off, icmp6len) 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; } |