diff options
-rw-r--r-- | sys/netinet/in_gif.c | 28 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 25 |
2 files changed, 10 insertions, 43 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 4bf0d4e518c..c43449d9ab2 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_gif.c,v 1.23 2002/03/15 18:19:52 millert Exp $ */ +/* $OpenBSD: in_gif.c,v 1.24 2002/05/30 04:19:44 itojun Exp $ */ /* $KAME: in_gif.c,v 1.50 2001/01/22 07:27:16 itojun Exp $ */ /* @@ -81,12 +81,6 @@ in_gif_output(ifp, family, m, rt) return EAFNOSUPPORT; } - /* multi-destination mode is not supported */ - if (ifp->if_flags & IFF_LINK0) { - m_freem(m); - return ENETUNREACH; - } - /* setup dummy tdb. it highly depends on ipipoutput() code. */ bzero(&tdb, sizeof(tdb)); bzero(&xfs, sizeof(xfs)); @@ -188,27 +182,17 @@ in_gif_input(struct mbuf *m, ...) /* this code will be soon improved. */ #define satosin(sa) ((struct sockaddr_in *)(sa)) for (i = 0, sc = gif_softc; i < ngif; i++, sc++) { - if (sc->gif_psrc == NULL - || sc->gif_pdst == NULL - || sc->gif_psrc->sa_family != AF_INET - || sc->gif_pdst->sa_family != AF_INET) { + if (sc->gif_psrc == NULL || sc->gif_pdst == NULL || + sc->gif_psrc->sa_family != AF_INET || + sc->gif_pdst->sa_family != AF_INET) { continue; } if ((sc->gif_if.if_flags & IFF_UP) == 0) continue; - if ((sc->gif_if.if_flags & IFF_LINK0) - && satosin(sc->gif_psrc)->sin_addr.s_addr == ip->ip_dst.s_addr - && satosin(sc->gif_pdst)->sin_addr.s_addr == INADDR_ANY) { - gifp = &sc->gif_if; - continue; - } - - if (satosin(sc->gif_psrc)->sin_addr.s_addr == - ip->ip_dst.s_addr - && satosin(sc->gif_pdst)->sin_addr.s_addr == - ip->ip_src.s_addr) + if (in_hosteq(satosin(sc->gif_psrc)->sin_addr, ip->ip_dst) && + in_hosteq(satosin(sc->gif_pdst)->sin_addr, ip->ip_src)) { gifp = &sc->gif_if; break; diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 126c062ba23..143ed123b9a 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_gif.c,v 1.20 2002/05/29 23:38:58 itojun Exp $ */ +/* $OpenBSD: in6_gif.c,v 1.21 2002/05/30 04:19:44 itojun Exp $ */ /* $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $ */ /* @@ -92,12 +92,6 @@ in6_gif_output(ifp, family, m, rt) return EAFNOSUPPORT; } - /* multi-destination mode is not supported */ - if (ifp->if_flags & IFF_LINK0) { - m_freem(m); - return ENETUNREACH; - } - /* setup dummy tdb. it highly depends on ipip_output() code. */ bzero(&tdb, sizeof(tdb)); bzero(&xfs, sizeof(xfs)); @@ -222,8 +216,7 @@ int in6_gif_input(mp, offp, proto) #define satoin6(sa) (((struct sockaddr_in6 *)(sa))->sin6_addr) for (i = 0, sc = gif_softc; i < ngif; i++, sc++) { - if (sc->gif_psrc == NULL || - sc->gif_pdst == NULL || + if (sc->gif_psrc == NULL || sc->gif_pdst == NULL || sc->gif_psrc->sa_family != AF_INET6 || sc->gif_pdst->sa_family != AF_INET6) { continue; @@ -232,18 +225,8 @@ int in6_gif_input(mp, offp, proto) if ((sc->gif_if.if_flags & IFF_UP) == 0) continue; - if ((sc->gif_if.if_flags & IFF_LINK0) && - IN6_ARE_ADDR_EQUAL(&satoin6(sc->gif_psrc), - &ip6->ip6_dst) && - IN6_IS_ADDR_UNSPECIFIED(&satoin6(sc->gif_pdst))) { - gifp = &sc->gif_if; - continue; - } - - if (IN6_ARE_ADDR_EQUAL(&satoin6(sc->gif_psrc), - &ip6->ip6_dst) && - IN6_ARE_ADDR_EQUAL(&satoin6(sc->gif_pdst), - &ip6->ip6_src)) { + if (IN6_ARE_ADDR_EQUAL(&satoin6(sc->gif_psrc), &ip6->ip6_dst) && + IN6_ARE_ADDR_EQUAL(&satoin6(sc->gif_pdst), &ip6->ip6_src)) { gifp = &sc->gif_if; break; } |