diff options
author | wollman <wollman@FreeBSD.org> | 1996-05-22 17:23:09 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-05-22 17:23:09 +0000 |
commit | 1ef953a26951c7ee5884ef7f7d97e26347e43e1a (patch) | |
tree | 50abd834e2c6e48d4b0ef4e379823254fac36c72 /sys/netinet | |
parent | 7a59b55013c5ede2b25108913910ef62554839b9 (diff) | |
download | FreeBSD-src-1ef953a26951c7ee5884ef7f7d97e26347e43e1a.zip FreeBSD-src-1ef953a26951c7ee5884ef7f7d97e26347e43e1a.tar.gz |
Conditionalize calls to IPFW code on COMPAT_IPFW. This is done slightly
unconventionally:
If COMPAT_IPFW is not defined, or if it is defined to 1, enable;
otherwise, disable.
This means that these changes actually have no effect on anyone at the
moment. (It just makes it easier for me to keep my code in sync.)
In the future, the `not defined' part of the hack should be eliminated,
but doing this now would require everyone to change their config files.
The same conditionals need to be made in ip_input.c as well for this to
ave any useful effect, but I'm not ready to do that right now.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_output.c | 11 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 6e1f90d..cf12527 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.37 1996/05/06 17:42:13 wollman Exp $ + * $Id: ip_output.c,v 1.38 1996/05/21 20:47:31 peter Exp $ */ #define _IP_VHL @@ -61,6 +61,13 @@ #endif #include <machine/in_cksum.h> +#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1 +#undef COMPAT_IPFW +#define COMPAT_IPFW 1 +#else +#undef COMPAT_IPFW +#endif + u_short ip_id; static struct mbuf *ip_insertoptions __P((struct mbuf *, struct mbuf *, int *)); @@ -325,10 +332,12 @@ sendit: /* * Check with the firewall... */ +#ifdef COMPAT_IPFW if (ip_fw_chk_ptr && !(*ip_fw_chk_ptr)(&ip, hlen, ifp, 1, &m)) { error = EACCES; goto done; } +#endif /* * If small enough for interface, can just send directly. diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 3aed00b..4f87951 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.29 1996/03/13 08:02:45 pst Exp $ + * $Id: raw_ip.c,v 1.30 1996/03/26 19:16:46 fenner Exp $ */ #include <sys/param.h> @@ -57,6 +57,13 @@ #include <netinet/ip_fw.h> +#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1 +#undef COMPAT_IPFW +#define COMPAT_IPFW 1 +#else +#undef COMPAT_IPFW +#endif + static struct inpcbhead ripcb; static struct inpcbinfo ripcbinfo; @@ -224,6 +231,7 @@ rip_ctloutput(op, so, level, optname, m) } return (error); +#ifdef COMPAT_IPFW case IP_FW_GET: if (ip_fw_ctl_ptr==NULL || op == PRCO_SETOPT) { if (*m) (void)m_free(*m); @@ -241,6 +249,7 @@ rip_ctloutput(op, so, level, optname, m) return (*ip_fw_ctl_ptr)(optname, m); return(error); +#endif case IP_RSVP_ON: return ip_rsvp_init(so); |