The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Upgrading FreeBSD - what went wrong
This section is for historical reference only.  There are my working notes and were not intended for publication.  But I thought they would be useful if someone encountered the same problems I was having.

That said, I think you might find IP Filter won't load more helpful than what appears below.

Please do not follow the instructions below as they do not lead directly to success.

How NOT to install IP Filter
I decided to recompile ipfilter under the new operating system.  For full details of this process, see IP Filter - second time around.   In brief, all I did was:
  1. make freebsd22 IPFILKERN=<kernel_name>
  2. make install-bsd

Then I tried to load the module:

modload /lkm/if_ipl.o

But I received the same errors as the first modload.  It must be something else.   I'll try a reboot now.

After a reboot, still the same problem.

Then I did a make clean followed by the steps above to compile ipfilter.  But no change.

Then I referred to my original installation notes for IP Filter.  I noticed that I was not doing the FreeBSD-2.2/minstall step.   It appeared to have trouble with patches.  I'm not sure.  After doing that step, I recompiled my kernel.  It failed part way through with something similar to:

../../netinet/ip_input.c: In function `ip_reass':
../../netinet/ip_input.c:533: `m0' undeclared (first use this function)
../../netinet/ip_input.c:533: (Each undeclared identifier is reported
only once
../../netinet/ip_input.c:533: for each function it appears in.)
*** Error code 1

Stop.

At this point, I retrieve ipfilter 3.2.10 and started from scratch.  I had been using 3.2.9beta10.  it failed on compile of the kernel.

At this point I went to bed.

Searching the file ../../netinet/ip_input.c, I found severeal duplicate sections of code.  I suspected the patches were at fault here.

Here is the output of the failed FreeBSD/minstall process.

su-2.02# FreeBSD-2.2/minstall
Patching ip_input.c, ip_output.c and in_proto.c
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/ip_input.c.orig  Sat May 24 13:37:16 1997
|--- /sys/netinet/ip_input.c    Sat May 24 13:38:58 1997
--------------------------
Patching file ip_input.c using Plan A...
Hunk #1 succeeded at 83 with fuzz 2 (offset 9 lines).
Hunk #2 failed at 322.
1 out of 2 hunks failed--saving rejects to ip_input.c.rej
Hmm...  The next patch looks like a new-style 
                    context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/ip_output.c.orig Sat May 24 14:07:24 1997
|--- /sys/netinet/ip_output.c   Sat May 24 15:00:29 1997
--------------------------
Patching file ip_output.c using Plan A...
Hunk #1 succeeded at 78 with fuzz 2 (offset 11 lines).
Hunk #2 failed at 90.
Hunk #3 failed at 353.
Hunk #4 failed at 585.
3 out of 4 hunks failed--saving rejects to ip_output.c.rej
Hmm...  The next patch looks like a new-style 
                    context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/in_proto.c.orig  Sat May 24 13:42:26 1997
|--- /sys/netinet/in_proto.c    Sat May 24 13:42:36 1997
--------------------------
Patching file in_proto.c using Plan A...
Hunk #1 succeeded at 91 (offset 2 lines).
done
Kernel configuration to update [IPFILTER3] 
Re-config'ing IPFILTER3...
You will now need to run "config" and build a new kernel

Next morning, I un-tar'd ipfilter to start fresh.  This time I read the contents of INSTALL.FreeBSD, where it says to make "freebsd first".  So I did the following

make freebsd
make install-bsd
FreeBSD/minstall

then config IPFILTER3 followed by make.  same problems

It was at this point that I contacted the author of a message I found in the IP Filter mailing list archives who had the same problem.  From that discussion, I realised that because I'd missed out on doing a FreeBSD/minstall the first time, I concluded that the source files had become corrupted.

after restoring original FreeBSD sources, I started again.  Here's what the FreeBSD/minstall process now gives:

[root@ns:/usr/ports/net/ip_fil3.2.10] # FreeBSD-2.2/minstall
Patching ip_input.c, ip_output.c and in_proto.c
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/ip_input.c.orig  Sat May 24 13:37:16 1997
|--- /sys/netinet/ip_input.c    Sat May 24 13:38:58 1997
--------------------------
Patching file ip_input.c using Plan A...
Hunk #1 succeeded at 74 with fuzz 2.
Hunk #2 succeeded at 368 with fuzz 2 (offset 55 lines).
Hmm...  The next patch looks like a new-style 
                    context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/ip_output.c.orig Sat May 24 14:07:24 1997
|--- /sys/netinet/ip_output.c   Sat May 24 15:00:29 1997
--------------------------
Patching file ip_output.c using Plan A...
Hunk #1 succeeded at 69 with fuzz 2 (offset 2 lines).
Hunk #2 succeeded at 87 with fuzz 1 (offset 8 lines).
Hunk #3 succeeded at 377 (offset 35 lines).
Hunk #4 succeeded at 594 (offset 20 lines).
Hmm...  The next patch looks like a new-style 
                    context diff to me...
The text leading up to this was:
--------------------------
|*** /sys/netinet/in_proto.c.orig  Sat May 24 13:42:26 1997
|--- /sys/netinet/in_proto.c    Sat May 24 13:42:36 1997
--------------------------
Patching file in_proto.c using Plan A...
Hunk #1 succeeded at 91 (offset 2 lines).
done
Kernel configuration to update [IPFILTER3] 
Re-config'ing IPFILTER3...
You will now need to run "config" and build a new kernel.

Then I recompiled the kernel without errors.  WOO HOO!