summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>1997-02-10 11:45:37 +0000
committerdarrenr <darrenr@FreeBSD.org>1997-02-10 11:45:37 +0000
commit020383fe0676ad7422f5f3e9fd360f42bfffcf40 (patch)
treeafeaa162945fd8fd95c0fb0bb60426423a271404 /sys/netinet/ip_output.c
parentd70a4d38b31d6e8adac50d4213af0eaf60c8251b (diff)
downloadFreeBSD-src-020383fe0676ad7422f5f3e9fd360f42bfffcf40.zip
FreeBSD-src-020383fe0676ad7422f5f3e9fd360f42bfffcf40.tar.gz
Add IP Filter hooks (from patches).
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 81358ba..186598b 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -80,6 +80,12 @@ static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
static int ip_setmoptions
__P((int, struct ip_moptions **, struct mbuf *));
+#if defined(IPFILTER_LKM) || defined(IPFILTER)
+extern int fr_check __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
+extern int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
+#endif
+
+
extern struct protosw inetsw[];
/*
@@ -331,6 +337,20 @@ ip_output(m0, opt, ro, flags, imo)
m->m_flags &= ~M_BCAST;
}
+#if defined(IPFILTER) || defined(IPFILTER_LKM)
+ {
+ struct mbuf *m0 = m;
+ /*
+ * looks like most checking has been done now...do a filter check
+ */
+ if (fr_checkp && (*fr_checkp)(ip, hlen, ifp, 1, &m0))
+ {
+ error = EHOSTUNREACH;
+ goto done;
+ }
+ ip = mtod(m = m0, struct ip *);
+ }
+#endif
sendit:
/*
* IpHack's section.
OpenPOWER on IntegriCloud