summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2001-09-25 18:40:52 +0000
committerbrooks <brooks@FreeBSD.org>2001-09-25 18:40:52 +0000
commit74063dd723dfad807cddf4ebc4e8bec0a0400b08 (patch)
tree047925a0cd0ed3cd9eac86164bb29b8242a91c33 /sys/netinet6
parent7f833143d714e030ab2c3c5e75763673067276e3 (diff)
downloadFreeBSD-src-74063dd723dfad807cddf4ebc4e8bec0a0400b08.zip
FreeBSD-src-74063dd723dfad807cddf4ebc4e8bec0a0400b08.tar.gz
Make faith loadable, unloadable, and clonable.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c9
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netinet6/in6.h2
-rw-r--r--sys/netinet6/in6_pcb.c14
-rw-r--r--sys/netinet6/ip6_input.c4
-rw-r--r--sys/netinet6/raw_ip6.c9
-rw-r--r--sys/netinet6/udp6_output.c2
-rw-r--r--sys/netinet6/udp6_usrreq.c9
8 files changed, 11 insertions, 40 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index fad1e05..2ae56e9 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -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 @@ icmp6_input(mp, offp, proto)
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 @@ icmp6_input(mp, offp, proto)
goto freeit;
}
}
-#endif
icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg);
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index c17bf55..8c837e1 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -138,6 +138,8 @@ static void in6_unlink_ifa __P((struct in6_ifaddr *, struct ifnet *));
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.
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 6ef9cc4..b16af5f 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -600,6 +600,8 @@ void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam));
#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
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index fa67043..430d5e5 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -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
@@ -1039,11 +1034,10 @@ in6_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard, ifp)
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.
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index c426e13..77557f3 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -121,8 +121,6 @@
#include <netinet6/ip6protosw.h>
-#include "faith.h"
-
#include <net/net_osdep.h>
extern struct domain inet6domain;
@@ -633,7 +631,6 @@ ip6_input(m)
/*
* 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) {
@@ -643,7 +640,6 @@ ip6_input(m)
goto hbhcheck;
}
}
-#endif
/*
* Now there is no reason to process the packet if it's not our own
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 5f89668..10a73cb 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -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 @@ rip6_input(mp, offp, proto)
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 */
diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c
index 37a820d..d1d6a19 100644
--- a/sys/netinet6/udp6_output.c
+++ b/sys/netinet6/udp6_output.c
@@ -107,8 +107,6 @@
#endif
#endif /*IPSEC*/
-#include "faith.h"
-
#include <net/net_osdep.h>
/*
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 6440dbe..448945d 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -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 @@ udp6_input(mp, offp, proto)
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++;
OpenPOWER on IntegriCloud