From ab94625826127118de82643f457dd0b7370df04f Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Wed, 16 Oct 2002 20:16:49 +0000 Subject: [PATCH] use encapcheck. Obtained from: KAME MFC after: 3 weeks --- sys/netinet/in_gif.c | 14 -------------- sys/netinet6/in6_gif.c | 16 ---------------- 2 files changed, 30 deletions(-) diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index d6508d5a0385..e0561300dd3f 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 83a2fe6263d1..50e37c392a2b 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;