Date: Sat, 14 Jul 2001 14:41:47 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: net@freebsd.org, audit@freebsd.org Subject: review request: if_faith modernization Message-ID: <20010714144147.A27610@Odin.AC.HMC.Edu>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Please review the following patch. It makes the faith interface loadable, unloadable, and clonable. It also converts it from a count device to an option device. A copy is also available at: http://people.freebsd.org/~brooks/patches/faith.diff Thanks, Brooks -- Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 Index: sys/conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.551 diff -u -r1.551 files --- sys/conf/files 2001/07/14 08:25:18 1.551 +++ sys/conf/files 2001/07/14 21:21:45 @@ -892,7 +892,7 @@ net/if_disc.c optional disc net/if_ef.c optional ef net/if_ethersubr.c optional ether -net/if_faith.c count faith +net/if_faith.c optional faith net/if_fddisubr.c optional fddi net/if_gif.c optional gif net/if_iso88025subr.c optional token @@ -1018,6 +1018,7 @@ netgraph/ng_echo.c optional netgraph_echo netgraph/ng_ether.c optional netgraph_ether netgraph/ng_frame_relay.c optional netgraph_frame_relay +netgraph/ng_gif.c optional netgraph_gif netgraph/ng_hole.c optional netgraph_hole netgraph/ng_iface.c optional netgraph_iface netgraph/ng_ksocket.c optional netgraph_ksocket Index: sys/modules/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/Makefile,v retrieving revision 1.190 diff -u -r1.190 Makefile --- sys/modules/Makefile 2001/07/08 04:17:26 1.190 +++ sys/modules/Makefile 2001/07/13 23:10:49 @@ -6,21 +6,122 @@ _random= random .endif -SUBDIR= 3dfx accf_data accf_http agp aha amr an aue \ - cam ccd cd9660 coda cue dc de digi ed fdescfs fdc fs fxp \ - if_disc if_ef if_gif if_ppp if_sl if_stf if_tap if_tun \ - ip6fw ipfilter ipfw ispfw joy kue lge \ - libmchain linux lnc md mii mlx msdosfs ncp netgraph nfs nge nmdm ntfs \ - nullfs nwfs pcn portalfs procfs ${_random} \ - rl rp sf sis sk sn snp sound sppp ste sym syscons sysvipc ti tl twe \ - tx udbp ugen uhid ukbd ulpt umapfs umass umodem ums unionfs urio usb \ +SUBDIR= 3dfx \ + accf_data \ + accf_http \ + agp \ + aha \ + amr \ + an \ + aue \ + cam \ + ccd \ + cd9660 \ + coda \ + cue \ + dc \ + de \ + digi \ + ed \ + fdescfs \ + fdc \ + fs \ + fxp \ + if_disc \ + if_ef \ + if_gif \ + if_ppp \ + if_sl \ + if_stf \ + if_tap \ + if_tun \ + ip6fw \ + ipfilter \ + ipfw \ + ispfw \ + joy \ + kue \ + lge \ + linux \ + lnc \ + md \ + mii \ + mlx \ + msdosfs \ + ncp \ + netgraph \ + nfs \ + nge \ + nmdm \ + ntfs \ + nullfs \ + nwfs \ + pcn \ + portalfs \ + procfs \ + ${_random} \ + rl \ + rp \ + sf \ + sis \ + sk \ + sn \ + snp \ + sound \ + sppp \ + ste \ + sym \ + syscons \ + sysvipc \ + ti \ + tl \ + twe \ + tx \ + udbp \ + ugen \ + uhid \ + ukbd \ + ulpt \ + umapfs \ + umass \ + umodem \ + ums \ + unionfs \ + urio \ + usb \ uscanner \ - vinum vpo vr vx wb wx xl + vinum \ + vpo \ + vr \ + vx \ + wb \ + wx \ + xl # XXX some of these can move to the general case when de-i386'ed .if ${MACHINE_ARCH} == "i386" -SUBDIR+=aac aic ar asr atspeaker bktr coff el fpu gnufpu ibcs2 mly \ - oltr pecoff ray s3 smbfs splash sr streams vesa wi +SUBDIR+=aac \ + aic \ + ar \ + asr \ + atspeaker \ + bktr \ + coff \ + el \ + fpu \ + gnufpu \ + ibcs2 \ + mly \ + oltr \ + pecoff \ + ray \ + s3 \ + smbfs \ + splash \ + sr \ + streams \ + vesa \ + wi .endif .if ${MACHINE} == "pc98" Index: sys/net/if_faith.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_faith.c,v retrieving revision 1.6 diff -u -r1.6 if_faith.c --- sys/net/if_faith.c 2001/07/05 14:42:54 1.6 +++ sys/net/if_faith.c 2001/07/14 01:21:02 @@ -46,9 +46,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "faith.h" -#if NFAITH > 0 - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -58,13 +55,16 @@ #include <sys/sockio.h> #include <sys/time.h> #include <sys/queue.h> +#include <sys/types.h> +#include <sys/malloc.h> +#include <machine/bus.h> /* XXX: Shouldn't really be required! */ +#include <sys/rman.h> #include <net/if.h> #include <net/if_types.h> #include <net/netisr.h> #include <net/route.h> #include <net/bpf.h> -#include <net/if_faith.h> #ifdef INET #include <netinet/in.h> @@ -82,56 +82,159 @@ #include <netinet6/ip6_var.h> #endif -#include "bpf.h" -#define NBPFILTER NBPF - #include <net/net_osdep.h> +#define FAITHNAME "faith" +#define FAITH_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */ + +struct faith_softc { + struct ifnet sc_if; /* must be first */ + struct resource *r_unit; + LIST_ENTRY(faith_softc) sc_list; +}; + static int faithioctl __P((struct ifnet *, u_long, caddr_t)); int faithoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)); static void faithrtrequest __P((int, struct rtentry *, struct sockaddr *)); +static int faithprefix __P((struct in6_addr *)); + +static int faithmodevent __P((module_t, int, void *)); + +static MALLOC_DEFINE(M_FAITH, FAITHNAME, "Firewall Assisted Tunnel Interface"); +static struct rman faithunits[1]; +LIST_HEAD(, faith_softc) faith_softc_list; -void faithattach __P((void *)); -PSEUDO_SET(faithattach, if_faith); +int faith_clone_create __P((struct if_clone *, int *)); +void faith_clone_destroy __P((struct ifnet *)); -static struct ifnet faithif[NFAITH]; +struct if_clone faith_cloner = + IF_CLONE_INITIALIZER(FAITHNAME, faith_clone_create, faith_clone_destroy); #define FAITHMTU 1500 -/* ARGSUSED */ -void -faithattach(faith) - void *faith; +static int +faithmodevent(mod, type, data) + module_t mod; + int type; + void *data; { - struct ifnet *ifp; - int i; + int err; + + switch (type) { + case MOD_LOAD: + faithunits->rm_type = RMAN_ARRAY; + faithunits->rm_descr = "configurable if_faith units"; + err = rman_init(faithunits); + if (err != 0) + return (err); + err = rman_manage_region(faithunits, 0, FAITH_MAXUNIT); + if (err != 0) { + printf("%s: faithunits: rman_manage_region: " + "Failed %d\n", FAITHNAME, err); + rman_fini(faithunits); + return (err); + } + LIST_INIT(&faith_softc_list); + if_clone_attach(&faith_cloner); - for (i = 0; i < NFAITH; i++) { - ifp = &faithif[i]; - bzero(ifp, sizeof(faithif[i])); - ifp->if_name = "faith"; - ifp->if_unit = i; - ifp->if_mtu = FAITHMTU; - /* LOOPBACK commented out to announce IPv6 routes to faith */ - ifp->if_flags = /* IFF_LOOPBACK | */ IFF_MULTICAST; - ifp->if_ioctl = faithioctl; - ifp->if_output = faithoutput; - ifp->if_type = IFT_FAITH; - ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_hdrlen = 0; - ifp->if_addrlen = 0; - if_attach(ifp); -#if NBPFILTER > 0 -#ifdef HAVE_OLD_BPF - bpfattach(ifp, DLT_NULL, sizeof(u_int)); -#else - bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int)); +#ifdef INET6 + faithprefix_p = faithprefix; #endif + + break; + case MOD_UNLOAD: +#ifdef INET6 + faithprefix_p = NULL; #endif + + if_clone_detach(&faith_cloner); + + while (!LIST_EMPTY(&faith_softc_list)) + faith_clone_destroy( + &LIST_FIRST(&faith_softc_list)->sc_if); + + err = rman_fini(faithunits); + if (err != 0) + return (err); + + break; + } + return 0; +} + +static moduledata_t faith_mod = { + "if_faith", + faithmodevent, + 0 +}; + +DECLARE_MODULE(if_faith, faith_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_faith, 1); + +int +faith_clone_create(ifc, unit) + struct if_clone *ifc; + int *unit; +{ + struct resource *r; + struct faith_softc *sc; + + if (*unit > FAITH_MAXUNIT) + return (ENXIO); + + if (*unit < 0) { + r = rman_reserve_resource(faithunits, 0, FAITH_MAXUNIT, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r == NULL) + return (ENOSPC); + *unit = rman_get_start(r); + } else { + r = rman_reserve_resource(faithunits, *unit, *unit, 1, + RF_ALLOCATED | RF_ACTIVE, NULL); + if (r == NULL) + return (ENOSPC); } + + sc = malloc(sizeof(struct faith_softc), M_FAITH, M_WAITOK); + bzero(sc, sizeof(struct faith_softc)); + + sc->sc_if.if_softc = sc; + sc->sc_if.if_name = FAITHNAME; + sc->sc_if.if_unit = *unit; + sc->r_unit = r; + + sc->sc_if.if_mtu = FAITHMTU; + /* Change to BROADCAST experimentaly to announce its prefix. */ + sc->sc_if.if_flags = /* IFF_LOOPBACK */ IFF_BROADCAST | IFF_MULTICAST; + sc->sc_if.if_ioctl = faithioctl; + sc->sc_if.if_output = faithoutput; + sc->sc_if.if_type = IFT_FAITH; + sc->sc_if.if_hdrlen = 0; + sc->sc_if.if_addrlen = 0; + if_attach(&sc->sc_if); + bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int)); + LIST_INSERT_HEAD(&faith_softc_list, sc, sc_list); + return (0); } +void +faith_clone_destroy(ifp) + struct ifnet *ifp; +{ + int err; + struct faith_softc *sc = (void *) ifp; + + LIST_REMOVE(sc, sc_list); + bpfdetach(ifp); + if_detach(ifp); + + err = rman_release_resource(sc->r_unit); + KASSERT(err == 0, ("Unexpected error freeing resource")); + + free(sc, M_FAITH); +} + int faithoutput(ifp, m, dst, rt) struct ifnet *ifp; @@ -144,7 +247,7 @@ if ((m->m_flags & M_PKTHDR) == 0) panic("faithoutput no HDR"); -#if NBPFILTER > 0 + /* BPF write needs to be handled specially */ if (dst->sa_family == AF_UNSPEC) { dst->sa_family = *(mtod(m, int *)); @@ -168,13 +271,8 @@ m0.m_len = 4; m0.m_data = (char *)⁡ -#ifdef HAVE_OLD_BPF bpf_mtap(ifp, &m0); -#else - bpf_mtap(ifp->if_bpf, &m0); -#endif } -#endif if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { m_freem(m); @@ -297,7 +395,7 @@ * XXX could be slow * XXX could be layer violation to call sys/net from sys/netinet6 */ -int +static int faithprefix(in6) struct in6_addr *in6; { @@ -323,4 +421,3 @@ return ret; } #endif -#endif /* NFAITH > 0 */ Index: sys/netinet/in_pcb.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_pcb.c,v retrieving revision 1.85 diff -u -r1.85 in_pcb.c --- sys/netinet/in_pcb.c 2001/06/29 12:07:29 1.85 +++ sys/netinet/in_pcb.c 2001/07/13 22:28:51 @@ -67,8 +67,6 @@ #include <netinet6/ip6_var.h> #endif /* INET6 */ -#include "faith.h" - #ifdef IPSEC #include <netinet6/ipsec.h> #include <netkey/key.h> @@ -870,11 +868,9 @@ #endif if (inp->inp_faddr.s_addr == INADDR_ANY && inp->inp_lport == lport) { -#if defined(NFAITH) && NFAITH > 0 if (ifp && ifp->if_type == IFT_FAITH && (inp->inp_flags & INP_FAITH) == 0) continue; -#endif if (inp->inp_laddr.s_addr == laddr.s_addr) return (inp); else if (inp->inp_laddr.s_addr == INADDR_ANY) { Index: sys/netinet/ip_icmp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_icmp.c,v retrieving revision 1.58 diff -u -r1.58 ip_icmp.c --- sys/netinet/ip_icmp.c 2001/06/23 17:17:58 1.58 +++ sys/netinet/ip_icmp.c 2001/07/13 21:10:23 @@ -46,6 +46,7 @@ #include <sys/sysctl.h> #include <net/if.h> +#include <net/if_types.h> #include <net/route.h> #define _IP_VHL @@ -62,11 +63,6 @@ #include <netkey/key.h> #endif -#include "faith.h" -#if defined(NFAITH) && NFAITH > 0 -#include <net/if_types.h> -#endif - #include <machine/in_cksum.h> /* @@ -275,7 +271,6 @@ m->m_len += hlen; m->m_data -= hlen; -#if defined(NFAITH) && 0 < NFAITH if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) { /* * Deliver very specific ICMP type only. @@ -288,7 +283,6 @@ goto freeit; } } -#endif #ifdef ICMPPRINTFS if (icmpprintfs) Index: sys/netinet/ip_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v retrieving revision 1.174 diff -u -r1.174 ip_input.c --- sys/netinet/ip_input.c 2001/06/23 17:17:58 1.174 +++ sys/netinet/ip_input.c 2001/07/13 21:12:18 @@ -60,6 +60,7 @@ #include <net/pfil.h> #include <net/if.h> +#include <net/if_types.h> #include <net/if_var.h> #include <net/if_dl.h> #include <net/route.h> @@ -86,11 +87,6 @@ #include <netkey/key.h> #endif -#include "faith.h" -#if defined(NFAITH) && NFAITH > 0 -#include <net/if_types.h> -#endif - #ifdef DUMMYNET #include <netinet/ip_dummynet.h> #endif @@ -636,7 +632,6 @@ if (ip->ip_dst.s_addr == INADDR_ANY) goto ours; -#if defined(NFAITH) && 0 < NFAITH /* * FAITH(Firewall Aided Internet Translator) */ @@ -648,7 +643,7 @@ m_freem(m); return; } -#endif + /* * Not for us; forward if possible and desirable. */ Index: sys/netinet/ip_output.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v retrieving revision 1.127 diff -u -r1.127 ip_output.c --- sys/netinet/ip_output.c 2001/06/11 18:38:11 1.127 +++ sys/netinet/ip_output.c 2001/07/13 21:13:53 @@ -63,8 +63,6 @@ #include <netinet/in_var.h> #include <netinet/ip_var.h> -#include "faith.h" - #include <machine/in_cksum.h> static MALLOC_DEFINE(M_IPMOPTS, "ip_moptions", "internet multicast options"); @@ -1158,9 +1156,7 @@ case IP_RECVRETOPTS: case IP_RECVDSTADDR: case IP_RECVIF: -#if defined(NFAITH) && NFAITH > 0 case IP_FAITH: -#endif error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -1196,11 +1192,9 @@ OPTSET(INP_RECVIF); break; -#if defined(NFAITH) && NFAITH > 0 case IP_FAITH: OPTSET(INP_FAITH); break; -#endif } break; #undef OPTSET @@ -1292,9 +1286,7 @@ case IP_RECVDSTADDR: case IP_RECVIF: case IP_PORTRANGE: -#if defined(NFAITH) && NFAITH > 0 case IP_FAITH: -#endif switch (sopt->sopt_name) { case IP_TOS: @@ -1332,11 +1324,9 @@ optval = 0; break; -#if defined(NFAITH) && NFAITH > 0 case IP_FAITH: optval = OPTBIT(INP_FAITH); break; -#endif } error = sooptcopyout(sopt, &optval, sizeof optval); break; Index: sys/netinet6/in6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6.c,v retrieving revision 1.13 diff -u -r1.13 in6.c --- sys/netinet6/in6.c 2001/07/02 21:02:08 1.13 +++ sys/netinet6/in6.c 2001/07/13 22:58:31 @@ -138,6 +138,8 @@ struct in6_multihead in6_multihead; /* XXX BSS initialization */ +int (*faithprefix_p)(struct in6_addr *); + /* * Subroutine for in6_ifaddloop() and in6_ifremloop(). * This routine does actual work. Index: sys/netinet6/in6.h =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6.h,v retrieving revision 1.14 diff -u -r1.14 in6.h --- sys/netinet6/in6.h 2001/06/24 20:43:01 1.14 +++ sys/netinet6/in6.h 2001/07/13 22:58:22 @@ -600,6 +600,8 @@ #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) + +extern int (*faithprefix_p)(struct in6_addr *); #endif /* _KERNEL */ __BEGIN_DECLS Index: sys/netinet6/icmp6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/icmp6.c,v retrieving revision 1.13 diff -u -r1.13 icmp6.c --- sys/netinet6/icmp6.c 2001/07/03 11:54:07 1.13 +++ sys/netinet6/icmp6.c 2001/07/13 23:00:30 @@ -103,11 +103,6 @@ #include <netkey/key.h> #endif -#include "faith.h" -#if defined(NFAITH) && 0 < NFAITH -#include <net/if_faith.h> -#endif - #include <net/net_osdep.h> #ifdef HAVE_NRL_INPCB @@ -439,8 +434,7 @@ goto freeit; } -#if defined(NFAITH) && 0 < NFAITH - if (faithprefix(&ip6->ip6_dst)) { + if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { /* * Deliver very specific ICMP6 type only. * This is important to deilver TOOBIG. Otherwise PMTUD @@ -455,7 +449,6 @@ goto freeit; } } -#endif icmp6stat.icp6s_inhist[icmp6->icmp6_type]++; icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg); Index: sys/netinet6/in6_pcb.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/in6_pcb.c,v retrieving revision 1.15 diff -u -r1.15 in6_pcb.c --- sys/netinet6/in6_pcb.c 2001/06/11 12:39:05 1.15 +++ sys/netinet6/in6_pcb.c 2001/07/13 23:01:21 @@ -100,11 +100,6 @@ #include <netinet/in_pcb.h> #include <netinet6/in6_pcb.h> -#include "faith.h" -#if defined(NFAITH) && NFAITH > 0 -#include <net/if_faith.h> -#endif - #ifdef IPSEC #include <netinet6/ipsec.h> #ifdef INET6 @@ -1001,11 +996,10 @@ u_short fport = fport_arg, lport = lport_arg; int faith; -#if defined(NFAITH) && NFAITH > 0 - faith = faithprefix(laddr); -#else - faith = 0; -#endif + if (faithprefix_p != NULL) + faith = (*faithprefix_p)(laddr); + else + faith = 0; /* * First look for an exact match. Index: sys/netinet6/ip6_input.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/ip6_input.c,v retrieving revision 1.28 diff -u -r1.28 ip6_input.c --- sys/netinet6/ip6_input.c 2001/07/02 21:02:09 1.28 +++ sys/netinet6/ip6_input.c 2001/07/13 21:19:34 @@ -120,8 +120,6 @@ #include <netinet6/ip6protosw.h> -#include "faith.h" - #include <net/net_osdep.h> extern struct domain inet6domain; @@ -632,7 +630,6 @@ /* * FAITH(Firewall Aided Internet Translator) */ -#if defined(NFAITH) && 0 < NFAITH if (ip6_keepfaith) { if (ip6_forward_rt.ro_rt && ip6_forward_rt.ro_rt->rt_ifp && ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { @@ -642,7 +639,6 @@ goto hbhcheck; } } -#endif /* * Now there is no reason to process the packet if it's not our own Index: sys/netinet6/raw_ip6.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/raw_ip6.c,v retrieving revision 1.11 diff -u -r1.11 raw_ip6.c --- sys/netinet6/raw_ip6.c 2001/06/11 12:39:06 1.11 +++ sys/netinet6/raw_ip6.c 2001/07/13 23:01:32 @@ -104,11 +104,6 @@ #include <machine/stdarg.h> -#include "faith.h" -#if defined(NFAITH) && 0 < NFAITH -#include <net/if_faith.h> -#endif - #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) @@ -142,13 +137,11 @@ rip6stat.rip6s_ipackets++; -#if defined(NFAITH) && 0 < NFAITH - if (faithprefix(&ip6->ip6_dst)) { + if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ m_freem(m); return IPPROTO_DONE; } -#endif init_sin6(&rip6src, m); /* general init */ Index: sys/netinet6/udp6_output.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/udp6_output.c,v retrieving revision 1.3 diff -u -r1.3 udp6_output.c --- sys/netinet6/udp6_output.c 2001/06/11 12:39:06 1.3 +++ sys/netinet6/udp6_output.c 2001/07/13 22:30:30 @@ -106,8 +106,6 @@ #endif #endif /*IPSEC*/ -#include "faith.h" - #include <net/net_osdep.h> /* Index: sys/netinet6/udp6_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/netinet6/udp6_usrreq.c,v retrieving revision 1.15 diff -u -r1.15 udp6_usrreq.c --- sys/netinet6/udp6_usrreq.c 2001/06/11 12:39:06 1.15 +++ sys/netinet6/udp6_usrreq.c 2001/07/13 23:01:40 @@ -106,11 +106,6 @@ #include <netinet6/ipsec6.h> #endif /*IPSEC*/ -#include "faith.h" -#if defined(NFAITH) && NFAITH > 0 -#include <net/if_faith.h> -#endif - /* * UDP protocol inplementation. * Per RFC 768, August, 1980. @@ -161,13 +156,11 @@ ip6 = mtod(m, struct ip6_hdr *); -#if defined(NFAITH) && 0 < NFAITH - if (faithprefix(&ip6->ip6_dst)) { + if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ m_freem(m); return IPPROTO_DONE; } -#endif udpstat.udps_ipackets++; Index: share/man/man4/faith.4 =================================================================== RCS file: /home/ncvs/src/share/man/man4/faith.4,v retrieving revision 1.10 diff -u -r1.10 faith.4 --- share/man/man4/faith.4 2001/06/11 12:38:48 1.10 +++ share/man/man4/faith.4 2001/07/14 02:14:28 @@ -36,7 +36,7 @@ .Nm faith .Nd IPv6-to-IPv4 TCP relay capturing interface .Sh SYNOPSIS -.Cd "device faith" Op Ar count +.Cd "device faith" .Sh DESCRIPTION The .Nm --- sys/modules/if_faith/Makefile.orig Fri Jul 13 19:55:29 2001 +++ sys/modules/if_faith/Makefile Fri Jul 13 16:06:52 2001 @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= if_faith +SRCS= if_faith.c opt_inet.h opt_inet6.h +NOMAN= + +opt_inet.h: + echo "#define INET 1" > ${.TARGET} + +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} + +.include <bsd.kmod.mk> [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7ULyaXY6L6fI4GtQRAhDLAKCuFUiaM2iTma0zV7W2CPg97JiEqQCcCgdm qOqdITYEPraWYbIs3eqgSPQ= =Ci8Q -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010714144147.A27610>
