diff options
author | ume <ume@FreeBSD.org> | 2002-10-16 20:16:49 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2002-10-16 20:16:49 +0000 |
commit | c3646a9ad481833a792b0aaae4605e7dbbf2e29b (patch) | |
tree | d0ebcfbaadb72dfc8cded482ff7096cc7e5502ab | |
parent | efa86acc1166c9712497315471dd5e85090f4c43 (diff) | |
download | FreeBSD-src-c3646a9ad481833a792b0aaae4605e7dbbf2e29b.zip FreeBSD-src-c3646a9ad481833a792b0aaae4605e7dbbf2e29b.tar.gz |
use encapcheck.
Obtained from: KAME
MFC after: 3 weeks
-rw-r--r-- | sys/netinet/in_gif.c | 14 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 16 |
2 files changed, 0 insertions, 30 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index d6508d5..e056130 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -380,22 +380,8 @@ int in_gif_attach(sc) struct gif_softc *sc; { -#ifndef USE_ENCAPCHECK - struct sockaddr_in mask4; - - bzero(&mask4, sizeof(mask4)); - mask4.sin_len = sizeof(struct sockaddr_in); - mask4.sin_addr.s_addr = ~0; - - if (!sc->gif_psrc || !sc->gif_pdst) - return EINVAL; - sc->encap_cookie4 = encap_attach(AF_INET, -1, sc->gif_psrc, - (struct sockaddr *)&mask4, sc->gif_pdst, (struct sockaddr *)&mask4, - (struct protosw *)&in_gif_protosw, sc); -#else sc->encap_cookie4 = encap_attach_func(AF_INET, -1, gif_encapcheck, &in_gif_protosw, sc); -#endif if (sc->encap_cookie4 == NULL) return EEXIST; return 0; diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 83a2fe6..50e37c3 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -379,24 +379,8 @@ int in6_gif_attach(sc) struct gif_softc *sc; { -#ifndef USE_ENCAPCHECK - struct sockaddr_in6 mask6; - - bzero(&mask6, sizeof(mask6)); - mask6.sin6_len = sizeof(struct sockaddr_in6); - mask6.sin6_addr.s6_addr32[0] = mask6.sin6_addr.s6_addr32[1] = - mask6.sin6_addr.s6_addr32[2] = mask6.sin6_addr.s6_addr32[3] = ~0; - mask6.sin6_scope_id = ~0; - - if (!sc->gif_psrc || !sc->gif_pdst) - return EINVAL; - sc->encap_cookie6 = encap_attach(AF_INET6, -1, sc->gif_psrc, - (struct sockaddr *)&mask6, sc->gif_pdst, (struct sockaddr *)&mask6, - (struct protosw *)&in6_gif_protosw, sc); -#else sc->encap_cookie6 = encap_attach_func(AF_INET6, -1, gif_encapcheck, (struct protosw *)&in6_gif_protosw, sc); -#endif if (sc->encap_cookie6 == NULL) return EEXIST; return 0; |