1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

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.
This commit is contained in:
Garrett Wollman 1996-05-22 17:23:09 +00:00
parent cd61f6c584
commit f9493383fc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15869
2 changed files with 20 additions and 2 deletions

View File

@ -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 @@ ip_output(m0, opt, ro, flags, imo)
/*
* 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.

View File

@ -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);