aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Reed <darrenr@FreeBSD.org>1997-04-03 10:47:12 +0000
committerDarren Reed <darrenr@FreeBSD.org>1997-04-03 10:47:12 +0000
commitbeec821495fdbe25d6d152d53d2adde00f1bef09 (patch)
treed214b3b324d192a95f6caf4dd47c0465908da628
parentbcff1846f03fbabd0f9e1d1a6fa2d978da6d58ae (diff)
Notes
-rw-r--r--sys/netinet/ip_input.c28
-rw-r--r--sys/netinet/ip_output.c11
2 files changed, 21 insertions, 18 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 0c70e456754d..eb7fb7bebc38 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id$
+ * $Id: ip_input.c,v 1.1.1.2 1997/04/03 10:39:25 darrenr Exp $
* $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
*/
@@ -319,7 +319,19 @@ tooshort:
* - Wrap: fake packet's addr/port <unimpl.>
* - Encapsulate: put it in another IP and send out. <unimp.>
*/
+#if defined(IPFILTER) || defined(IPFILTER_LKM)
+ /*
+ * Check if we want to allow this packet to be processed.
+ * Consider it to be bad if not.
+ */
+ if (fr_check) {
+ struct mbuf *m1 = m;
+ if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m1) || !m1)
+ return;
+ ip = mtod(m = m1, struct ip *);
+ }
+#endif
#ifdef COMPAT_IPFW
if (ip_fw_chk_ptr) {
int action;
@@ -347,20 +359,6 @@ tooshort:
return;
#endif
-#if defined(IPFILTER) || defined(IPFILTER_LKM)
- /*
- * Check if we want to allow this packet to be processed.
- * Consider it to be bad if not.
- */
- if (fr_check) {
- struct mbuf *m1 = m;
-
- if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m1) || !m1)
- goto next;
- ip = mtod(m = m1, struct ip *);
- }
-#endif
-
/*
* Process options and, if not destined for us,
* ship it on. ip_dooptions returns 1 when an
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index b70802577c50..40a1b4ae2709 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id: ip_output.c,v 1.52 1997/02/28 19:40:48 fenner Exp $
+ * $Id: ip_output.c,v 1.1.1.2 1997/04/03 10:39:32 darrenr Exp $
*/
#define _IP_VHL
@@ -75,14 +75,16 @@ static void ip_mloopback
__P((struct ifnet *, struct mbuf *, struct sockaddr_in *));
static int ip_getmoptions
__P((int, struct ip_moptions *, struct mbuf **));
-static int ip_optcopy __P((struct ip *, struct ip *));
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)
+int ip_optcopy __P((struct ip *, struct ip *));
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 **));
+#else
+static int ip_optcopy __P((struct ip *, struct ip *));
#endif
@@ -580,7 +582,10 @@ ip_insertoptions(m, opt, phlen)
* Copy options from ip to jp,
* omitting those not copied during fragmentation.
*/
-static int
+#if !defined(IPFILTER) && !defined(IPFILTER_LKM)
+static
+#endif
+int
ip_optcopy(ip, jp)
struct ip *ip, *jp;
{