Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2005 14:15:35 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Scott Long <scottl@samsco.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sbin/ipf Makefile Makefile.inc src/sbin/ipf/ipf Makefile src/sbin/ipf/ipfs Makefile src/sbin/ipf/ipfstat Makefile src/sbin/ipf/ipftest Makefile src/sbin/ipf/ipmon Makefile src/sbin/ipf/ipnat Makefile src/sbin/ipf/ippool Makefile ...
Message-ID:  <20050426111535.GA76030@orion.daedalusnetworks.priv>
In-Reply-To: <20050426002859.GA83943@gothmog.gr>
References:  <200504251855.j3PItq62024205@repoman.freebsd.org> <20050425230258.GA43254@gothmog.gr> <426D854B.6050801@samsco.org> <20050426002859.GA83943@gothmog.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-04-26 03:28, Giorgos Keramidas <keramida@freebsd.org> wrote:
> A buildworld takes a few hours here (slow workstation).  I'll look again
> into this after the current runs finishes, but it may take a few hours
> before I have a definitive buildworld unbreaking diff.
>
> In the mean time, of course, Darren may fix this, but anyway :)

So far, I've discovered the following things that may need to change:

% --- contrib/ipfilter/ip_fil_freebsd.c   25 Apr 2005 18:20:08 -0000      1.2
% +++ contrib/ipfilter/ip_fil_freebsd.c   26 Apr 2005 10:46:20 -0000
% @@ -61,7 +61,7 @@
%  #include <net/if.h>
%  #if __FreeBSD_version >= 300000
%  # include <net/if_var.h>
% -# if !defined(IPFILTER_LKM)
% +# if !defined(IPFILTER_LKM) && defined(KERNEL)
%  #  include "opt_ipfilter.h"
%  # endif
%  #endif
% @@ -79,7 +79,7 @@
%  #include <netinet/tcpip.h>
%  #include <netinet/ip_icmp.h>
%  #ifndef _KERNEL
% -# include "netinet/ipf.h"
% +# include "ipf.h"
%  #endif
%  #include "netinet/ip_compat.h"
%  #ifdef USE_INET6

I'm not sure if this change is correct.  There is no netinet/ipf.h
header though.  There is an ipf.h in src/contrib/ipfilter, but it's not
very obvious if we really need to pull it in ip_fil_freebsd.c

% Index: contrib/ipfilter/lib/ipft_tx.c
% ===================================================================
% RCS file: /home/ncvs/src/contrib/ipfilter/lib/ipft_tx.c,v
% retrieving revision 1.2
% diff -u -r1.2 ipft_tx.c
% --- contrib/ipfilter/lib/ipft_tx.c      25 Apr 2005 18:20:12 -0000      1.2
% +++ contrib/ipfilter/lib/ipft_tx.c      26 Apr 2005 10:35:12 -0000
% @@ -280,8 +280,6 @@
%         ip->ip_dst.s_addr = tx_hostnum(*cpp, &r);
%         cpp++;
%         if (*cpp && ip->ip_p == IPPROTO_TCP) {
% -               extern  char    _tcp_flagset[];
% -               extern  u_char  _tcp_flags[];
%                 char    *s, *t;

The _tcp_flagset[] and _tcp_flags[] vectors are declared as "static"
further up in the same file.  Declaring them again, as "extern" is not a
good idea here.

% Index: sys/contrib/ipfilter/netinet/fil.c
% Index: sys/contrib/ipfilter/netinet/ip_auth.c
% Index: sys/contrib/ipfilter/netinet/ip_frag.c
% Index: sys/contrib/ipfilter/netinet/ip_nat.c

All these files have grown duplicate rcsid[] vectors; one with a
"$FreeBSD$" RCS id and one with a new (obviously) "$Id$" line.

IMHO, the duplicates should go away or at least be moved in rcsid_ipf[]
vectors.

% Index: rescue/rescue/Makefile
% ===================================================================
% RCS file: /home/ncvs/src/rescue/rescue/Makefile,v
% retrieving revision 1.42
% diff -u -r1.42 Makefile
% --- rescue/rescue/Makefile      18 Mar 2005 12:55:07 -0000      1.42
% +++ rescue/rescue/Makefile      26 Apr 2005 09:31:45 -0000
% @@ -124,7 +124,8 @@
%  .endif
%
%  .if !defined(NO_IPFILTER)
% -CRUNCH_PROGS_sbin+= ipf ipfs ipfstat ipmon ipnat
% +CRUNCH_SRCDIRS+= sbin/ipf
% +CRUNCH_PROGS_sbin/ipf+= ipf ipfs ipfstat ipmon ipnat
%  .endif

This is needed to let src/rescue pick the ipf related programs from the
correct subdir of the src/sbin/ipf tree.

%  # crunchgen does not like C++ programs; this should be fixed someday
% Index: sbin/ipf/Makefile.inc
% ===================================================================
% RCS file: /home/ncvs/src/sbin/ipf/Makefile.inc,v
% retrieving revision 1.1
% diff -u -r1.1 Makefile.inc
% --- sbin/ipf/Makefile.inc       25 Apr 2005 18:55:50 -0000      1.1
% +++ sbin/ipf/Makefile.inc       26 Apr 2005 10:15:43 -0000
% @@ -6,6 +6,7 @@
%  CFLAGS+=       -I${.CURDIR}/../../../contrib/ipfilter/tools
%  CFLAGS+=       -I${.CURDIR}/../../../sys
%  CFLAGS+=       -I${.CURDIR}/../../../sys/contrib/ipfilter
% +CFLAGS+=       -I${.CURDIR}/../../../sys/contrib/ipfilter/netinet
%  CFLAGS+=       -DSTATETOP -D__UIO_EXPOSE

This is needed for `ipl.h'.  Otherwise, the build of src/sbin/ipf breaks
with the following error:

    ===> libipf (depend)
    rm -f .depend
    [...]
    /usr/src/sbin/ipf/libipf/../../../contrib/ipfilter/lib/ipf_dotuning.c:4:17: ipl.h: No such file or directory
    mkdep: compile failed
    *** Error code 1

% -.PATH: ${.CURDIR}/../../../contrib/ipfilter    \
% -       ${.CURDIR}/../../../contrib/ipfilter/lib        \
% -       ${.CURDIR}/../../../contrib/ipfilter/tools      \
% -       ${.CURDIR}/../../../contrib/ipfilter/man
% +.PATH: ${.CURDIR}/../../../contrib/ipfilter \
% +       ${.CURDIR}/../../../contrib/ipfilter/lib \
% +       ${.CURDIR}/../../../contrib/ipfilter/tools \
% +       ${.CURDIR}/../../../contrib/ipfilter/man \
% +       ${.CURDIR}/../../../sys/contrib/ipfilter/netinet

The misalignment of the \ continuation characters is probably not so
bad, but sys/contrib/ipfilter/netinet is needed here, otherwise fil.c
cannot be located and "make depend" fails again:

    ===> ipftest (depend)
    ${_MKTARGET_CREATE} expands to empty string
    [...]
    make: don't know how to make fil.c. Stop
    *** Error code 2

% Index: sbin/ipf/ipftest/Makefile
% ===================================================================
% RCS file: /home/ncvs/src/sbin/ipf/ipftest/Makefile,v
% retrieving revision 1.1
% diff -u -r1.1 Makefile
% --- sbin/ipf/ipftest/Makefile   25 Apr 2005 18:55:51 -0000      1.1
% +++ sbin/ipf/ipftest/Makefile   26 Apr 2005 10:45:47 -0000
% @@ -8,7 +8,7 @@
%  SRCS=          ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
%                 ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \
%                 ip_pool.c ip_scan.c ip_sync.c ip_rules.c \
% -               ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \
% +               ip_log.c ippool_y.c ippool_l.c ipf_y.c \

There is no ip_fil.c any more.  Changing this to ip_fil_freebsd.c
doesn't seem to work quite right either :-(

After all these changes are applied and ip_fil.c is replaced with
ip_fil_freebsd.c in src/sbin/ipf/ipftest/Makefile, I can "make depend"
and get half-way through a build of src/sbin/ipf/*, but things are still
broken, but I am really running out of clues about what else could be
done to fix ipfilter in CURRENT...

% In file included from /usr/src/sbin/ipf/ipftest/../../../contrib/ipfilter/ip_fil_freebsd.c:49:
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:156: warning: conflicting types for built-in function 'log'
% In file included from /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:248,
%                  from /usr/src/sbin/ipf/ipftest/../../../contrib/ipfilter/ip_fil_freebsd.c:49:
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/libkern.h:101: warning: conflicting types for built-in function 'strdup'
% In file included from /usr/src/sbin/ipf/ipftest/../../../contrib/ipfilter/ip_fil_freebsd.c:49:
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:278: error: syntax error before "splbio"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:278: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:279: error: syntax error before "splcam"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:279: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:280: error: syntax error before "splclock"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:280: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:281: error: syntax error before "splhigh"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:281: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:282: error: syntax error before "splimp"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:282: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:283: error: syntax error before "splnet"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:283: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:284: error: syntax error before "splsoftcam"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:284: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:285: error: syntax error before "splsoftclock"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:285: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:286: error: syntax error before "splsofttty"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:286: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:287: error: syntax error before "splsoftvm"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:287: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:288: error: syntax error before "splsofttq"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:288: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:289: error: syntax error before "splstatclock"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:289: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:290: error: syntax error before "spltty"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:290: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:291: error: syntax error before "splvm"
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:291: warning: return type defaults to `int'
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:292: error: syntax error before "ipl"
% In file included from /usr/src/sbin/ipf/ipftest/../../../contrib/ipfilter/ip_fil_freebsd.c:49:
% /usr/src/sbin/ipf/ipftest/../../../sys/sys/systm.h:38:1: unterminated #ifndef
% *** Error code 1
%
% Stop in /usr/src/sbin/ipf/ipftest.
% *** Error code 1
%
% Stop in /usr/src/sbin/ipf.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050426111535.GA76030>