History log of /freebsd-10-stable/sys/contrib/ipfilter/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
353164 07-Oct-2019 cy

MFC r353116:

Add missing definition in DEBUG code.

352866 29-Sep-2019 cy

MFC r352737:

ipf mistakenly regards UDP packets with a checksum of 0xffff as bad.

Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443

351468 25-Aug-2019 cy

MFC r351380:

Specifying array sizes for fully initialized tables at compile time is
redundant.

349931 12-Jul-2019 cy

MFC r349927, r349929:

r349927:
Resolve IPv6 checksum errors with stateful inspection. According to
PR/203585 this appears to have been broken by r235959, which predates
the ipfilter 5.1.2 import into FreeBSD.

The IPv6 checksum calculation is incorrect. To resolve this we call
in6_cksum() to do the the heavy lifting for us, through a new function
ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
is added to aid with future debugging.

Plus whitespace adjustments (r348989).

PR: 203275, 203585
Differential Revision: https://reviews.freebsd.org/D20583

r349929:
Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c.
The reason for this is that ipftest(8), which still works on FreeBSD-11,
fails to link to it, breaking stable/11 builds.

ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle.
glebius@ suggested we disable building it until I can get around to
fixing it. Hence this was not caught in -current.

The intention is to fix ipftest(8) as it is used by the netbsd-tests
(imported by ngie@ many moons ago) for regression testing.

349927 12-Jul-2019 cy

MFC r348987, r348989:

Resolve IPv6 checksum errors with stateful inspection. According to
PR/203585 this appears to have been broken by r235959, which predates
the ipfilter 5.1.2 import into FreeBSD.

The IPv6 checksum calculation is incorrect. To resolve this we call
in6_cksum() to do the the heavy lifting for us, through a new function
ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
is added to aid with future debugging.

Plus whitespace adjustments (r348989).

PR: 203275, 203585
Differential Revision: https://reviews.freebsd.org/D20583

349903 11-Jul-2019 cy

MFC 349843:

Update frtuc struct comments. It not only defines TCP things we are
interested in but also UDP.

While at it document the source and destination port variables.

349902 11-Jul-2019 cy

MFC r349842:

Correct the description for the low port in the port compare struct.

Adjust the high port description to match that of the low port
description.

346982 01-May-2019 cy

MFC r346804:

Left justify a function header brace as it should be.
No functional change.

344113 14-Feb-2019 cy

MFC r343591:

Do not obtain an already held read lock. This causes a witness panic when
ipfs is invoked. This is the second of two panics resolving PR 235110.

PR: 235110
Reported by: David.Boyd49@twc.com

343691 03-Feb-2019 cy

MFC r343600:

Document the instance context pointer.

342685 02-Jan-2019 cy

MFC r342596:

Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>

342641 31-Dec-2018 cy

MFC r342385:

Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

342608 30-Dec-2018 cy

MFC r342547:

Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

342607 30-Dec-2018 cy

MFC r342377:

Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

342606 30-Dec-2018 cy

MFC r341279:

Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ
is defined in net/if.h, therefore the condition is never met and
confusing to those who follow.

342588 29-Dec-2018 cy

MFC r342374:

Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
source file.

342023 13-Dec-2018 cy

MFC r341650:

Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
age, more to come.

341740 08-Dec-2018 cy

MFC r341377, r341388 (fixup):

Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

341739 08-Dec-2018 cy

MFC r341384:

Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

341708 07-Dec-2018 cy

MFC r341280:

Clean up a rather useless conditional structure member definition.

341615 06-Dec-2018 cy

MFC r341265:

Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

341379 01-Dec-2018 cy

MFC r340868:

An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.

341378 01-Dec-2018 cy

MFC r340909:

Combine two lines into one following unifdef for r255332.

338171 22-Aug-2018 cy

MFC r338047:

The bucket index is subtracted by one at lines 2304 and 2314. When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

338170 22-Aug-2018 cy

MFC r338046:

Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
are situated next to error counters and/or in one instance prior to the
-1 return from various functions. This was useful in diagnosis of
PR/208566 and will be handy in the future diagnosing NAT failures.

PR: 208566

338169 22-Aug-2018 cy

MFC r338045:

Expose np (nat_t - an entry in the nat table structure) in the DTrace
probe when nat fails (label badnat). This is useful in diagnosing
failed NAT issues and was used in PR/208566.

PR: 208566

338123 21-Aug-2018 cy

MFC r337410:

Remove redundant and incorrect default definition of AF_INET6. AF_INET6
is defined in sys/socket.h where it's defined as 28.

A bit of trivia: On NetBSD AF_INET6 is defined as 24. On Solaris it is
defined as 26. This is probably why Darren defaulted to 26, because
ipfilter was originally written for SunOS 4 and Solaris many moons ago.

337948 17-Aug-2018 cy

MFC r337558, r337560

r337558:
Identify the return value (rval) that led to the IPv4 NAT failure
in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in
dtrace probes.

This is currently being used to diagnose NAT failures in PR/208566. It's
rather handy so this commit makes it available for future diagnosis and
debugging efforts.

PR: 208566

r337560:
Correct a comment. Should have been detected by ipf_nat_in() not
ipf_nat_out().

334202 25-May-2018 cy

MFC r333392-r333393, r333427

r333392:
Fix memory leak. (CID 1199373).

r333393:
Document intentional fallthrough. (CID 976535)

r333427:
Fix style error introduced in r333393.

Reported by: jhb, imp, phk

328274 23-Jan-2018 cy

MFC r327718:

When growing the state, also grow the seed array. Otherwise memory
that was not allocated will be accessed.

This necessitated refactoring state seed allocation from
ipf_state_soft_init() into a new common ipf_state_seed_alloc() function
as it is now also used by ipf_state_rehash() when changing the size of
the state hash table in addition to by ipf_state_soft_init() during
initialization.

According to Christos Zoulas <christos@NetBSD.org>:

The bug was encountered by a NetBSD vendor who's customer machines had
large ipfilter states. The bug was reliably triggered by resizing the
state variables using "ipf -T".

Submitted by: Christos Zoulas <christos@NetBSD.org>
Reviewed by: delphij, rgrimes
Obtained from: NetBSD ip_state.c CVS revs r1.9 and r1.10
Differential Revision: https://reviews.freebsd.org/D13755

328204 20-Jan-2018 cy

MFC r327913:

Remove redundant variable.

328203 20-Jan-2018 cy

MFC r327912:

Though this block of code is not used by FreeBSD, correct a call to
sprintf() with a macro call to SNPRINTF similar to other calls to
SNPRINTF within this same block.

327717 09-Jan-2018 cy

MFC r327540:

Correct function name in description block.

324513 11-Oct-2017 cy

MFC r323945 and 323962

Fix misspellings, typos and /* border misalignments.

323842 21-Sep-2017 cy

MFC r323715:

Don't use an apostrophe in a possesive pronoun.

323694 18-Sep-2017 cy

MFC r323478:

Improve the wording of a comment describing why EAGAIN is the error code.

323231 06-Sep-2017 cy

MFC r322073:

Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).

Approved by: re (kib)

319633 06-Jun-2017 cy

MFC r318998:

Fix return value of ip_sync_nat. Previously, regardless of error it
always returned a return code of 0.

Obtained from: NetBSD ip_sync.c r1.5

319179 30-May-2017 cy

MFC r318606:

Refactor & compact struct i6addr_t #ifdef: remove redundant structure
definintion when USE_INET6 is false.

319176 30-May-2017 cy

MFC r318745:

Remove redundant variable declaration.

317434 26-Apr-2017 cy

MFC r316810, r316814, r316816, r316991:

Keep state incorrectly assumes keep frags. This is counter to the
ipfilter man pages. This also currently restricts keep frags to only when
keep state is used, which is redundant because keep state currently
assumes keep frags. This commit fixes this.

To the user this change means that to maintain the current behaviour
one must add keep frags to any ipfilter keep state rule (as documented
in the man pages).

This patch also allows the flexability to specify and use keep frags
separate from keep state, as documented in an example in ipf.conf.5,
instead of the currently broken behaviour.

MFC suggested by: rgrimes
Relnotes: yes

317243 21-Apr-2017 cy

MFC r317139 for real.

Restore prototype accidently removed by r316811. Also remove $NetBSD$
accidentally added.

Reported by: hps, lwhsu
Pointy hat to: cy

317242 21-Apr-2017 cy

MFC r316811, r317139:

Add missing free()'s after calls to randomize().

PR: NetBSD PR/50559
Obtained from: Netbsd radix_ipf.c r1.6

317241 21-Apr-2017 cy

MFC r316809:

Fix a use after free panic in ipfilter's fragment processing.
Memory is malloc'd, then a search for a match in the fragment table
is made and if the fragment matches, the wrong fragment table is
freed, causing a use after free panic. This commit fixes this.

A symptom of the problem is a kernel page fault in bcopy() called by
ipf_frag_lookup() at line 715 in ip_frag.c. Another symptom is a
kernel page fault in ipf_frag_delete() when called by ipf_frag_expire()
via ipf_slowtimer().

315079 11-Mar-2017 cy

MFC r312886:

Fix lookup of original destination address when using a redirect rule.
Transparent proxying, e.g. to squid, is an example of this.

Obtained from: NetBSD ip_nat.c r1.17, ip_nat6.c r1.10

314667 04-Mar-2017 avg

MFC r283291: don't use CALLOUT_MPSAFE with callout_init()

The main purpose of this MFC is to reduce conflicts for other merges.
Parts of the original change have already "trickled down" via individual MFCs.


/freebsd-10-stable/sys/amd64/amd64/mp_watchdog.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
/freebsd-10-stable/sys/cddl/dev/profile/profile.c
/freebsd-10-stable/sys/compat/ndis/subr_ntoskrnl.c
netinet/ip_fil_freebsd.c
/freebsd-10-stable/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c
/freebsd-10-stable/sys/dev/ath/if_ath.c
/freebsd-10-stable/sys/dev/ce/if_ce.c
/freebsd-10-stable/sys/dev/cp/if_cp.c
/freebsd-10-stable/sys/dev/ctau/if_ct.c
/freebsd-10-stable/sys/dev/cx/if_cx.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_main.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_sge.c
/freebsd-10-stable/sys/dev/dcons/dcons_os.c
/freebsd-10-stable/sys/dev/drm2/drm_irq.c
/freebsd-10-stable/sys/dev/drm2/i915/intel_display.c
/freebsd-10-stable/sys/dev/glxsb/glxsb.c
/freebsd-10-stable/sys/dev/gxemul/cons/gxemul_cons.c
/freebsd-10-stable/sys/dev/hifn/hifn7751.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/if_ndis/if_ndis.c
/freebsd-10-stable/sys/dev/isci/isci_io_request.c
/freebsd-10-stable/sys/dev/mfi/mfi.c
/freebsd-10-stable/sys/dev/mwl/if_mwl.c
/freebsd-10-stable/sys/dev/nand/nandsim_chip.c
/freebsd-10-stable/sys/dev/ntb/ntb_hw/ntb_hw.c
/freebsd-10-stable/sys/dev/nxge/if_nxge.c
/freebsd-10-stable/sys/dev/oce/oce_if.c
/freebsd-10-stable/sys/dev/patm/if_patm_attach.c
/freebsd-10-stable/sys/dev/rndtest/rndtest.c
/freebsd-10-stable/sys/dev/safe/safe.c
/freebsd-10-stable/sys/dev/sound/midi/mpu401.c
/freebsd-10-stable/sys/dev/sound/pci/atiixp.c
/freebsd-10-stable/sys/dev/sound/pci/es137x.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdac.c
/freebsd-10-stable/sys/dev/sound/pci/via8233.c
/freebsd-10-stable/sys/dev/twa/tw_osl_freebsd.c
/freebsd-10-stable/sys/dev/tws/tws.c
/freebsd-10-stable/sys/dev/ubsec/ubsec.c
/freebsd-10-stable/sys/dev/virtio/random/virtio_random.c
/freebsd-10-stable/sys/dev/xen/netfront/netfront.c
/freebsd-10-stable/sys/fs/nfs/nfs_commonport.c
/freebsd-10-stable/sys/gdb/gdb_cons.c
/freebsd-10-stable/sys/geom/gate/g_gate.c
/freebsd-10-stable/sys/geom/journal/g_journal.c
/freebsd-10-stable/sys/geom/mirror/g_mirror.c
/freebsd-10-stable/sys/geom/raid3/g_raid3.c
/freebsd-10-stable/sys/geom/sched/gs_rr.c
/freebsd-10-stable/sys/i386/i386/mp_watchdog.c
/freebsd-10-stable/sys/kern/init_main.c
/freebsd-10-stable/sys/kern/kern_synch.c
/freebsd-10-stable/sys/kern/kern_thread.c
/freebsd-10-stable/sys/kern/subr_vmem.c
/freebsd-10-stable/sys/kern/uipc_domain.c
/freebsd-10-stable/sys/mips/cavium/octe/ethernet.c
/freebsd-10-stable/sys/mips/cavium/octeon_rnd.c
/freebsd-10-stable/sys/mips/nlm/dev/net/xlpge.c
/freebsd-10-stable/sys/mips/rmi/dev/xlr/rge.c
/freebsd-10-stable/sys/net/if_spppsubr.c
/freebsd-10-stable/sys/net80211/ieee80211_ht.c
/freebsd-10-stable/sys/net80211/ieee80211_hwmp.c
/freebsd-10-stable/sys/net80211/ieee80211_mesh.c
/freebsd-10-stable/sys/net80211/ieee80211_node.c
/freebsd-10-stable/sys/net80211/ieee80211_proto.c
/freebsd-10-stable/sys/netgraph/netflow/ng_netflow.c
/freebsd-10-stable/sys/netgraph/netgraph.h
/freebsd-10-stable/sys/netinet/in_pcb.c
/freebsd-10-stable/sys/netinet/ip_mroute.c
/freebsd-10-stable/sys/netinet/tcp_hostcache.c
/freebsd-10-stable/sys/netinet/tcp_subr.c
/freebsd-10-stable/sys/netinet6/in6_rmx.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_dummynet.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_fw_dynamic.c
/freebsd-10-stable/sys/netpfil/pf/if_pfsync.c
/freebsd-10-stable/sys/ofed/include/linux/timer.h
/freebsd-10-stable/sys/ofed/include/linux/workqueue.h
/freebsd-10-stable/sys/powerpc/mambo/mambo_console.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_console.c
/freebsd-10-stable/sys/sys/callout.h
/freebsd-10-stable/sys/vm/uma_core.c
/freebsd-10-stable/sys/x86/x86/mca.c
314251 25-Feb-2017 cy

MFC r312787:

Currently the fragment info is placed at the top of the linked list
under a shared read lock. This patch attempts to upgrade the lock to
an exclusive write lock. If the exclusive write lock fails to be
obtained, the current fragment is not placed at the head of the list.

This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
effectively removed the section of code that performed the reordering).

The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.

The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
by emulating the mutex in userspace when exercised by ipftest(1).

Inspired by: NetBSD ip_frag.c r1.4

313648 11-Feb-2017 cy

MFC r311950 (by bz):

Get rid of a compiler warning which I saw too often.
Include netinet/in.h before ip_compat.t which will then check if
IPPROTO_IPIP is defined or not. Doing it the other way round,
ip_compat.h would not find it defined and netinet/in.h then
redefine it.

305138 31-Aug-2016 dim

MFC r304953:

Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by: The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to: dim

302015 19-Jun-2016 cy

MFC r300259:

Enable the two ip_frag tuneables. The code is there but the two
ip_frag tuneables aren't registered in the ipf_tuners linked list.
This commmit enables the two existing ip_frag tuneables by registering
them.

MFC r300260:

Remove extraneous blank line.

299749 14-May-2016 cy

MFC r298030: Use NULL instead of 0 for pointer comparison.

296923 16-Mar-2016 cy

MFC r296299 - Remove redundant NULL pointer comparison.

Reported by: PVS-Studio (V595) in Differential Revision D5245

292979 31-Dec-2015 cy

MFC r292813.

Correct __FreeBSD__ check.

292811 27-Dec-2015 cy

MFC r292518.

Don't assume checksums will be calculated later when fastfoward is
enabled (by default in r290383).

PR: 72210

289628 20-Oct-2015 cy

MFC r289480. Really fix ipfilter bug 3600459.

Obtained from: ipfilter cvs repo r1.48.2.25, r1.72 and NetBSD repo r1.4

289210 13-Oct-2015 cy

MFC r288910: On some interfaces, ipfilter drops UDP packets with zero
checkum. This commit fixes that.

PR: 166372
Submitted by: mk@neon1.net
Reviewed by: Darren Reed <darrenr@reed.wattle.id.au>

288250 26-Sep-2015 cy

MFC r287674, r287675. Fix ipfilter bug 3600459 NAT bucket count wrong.

Obtained from: ipfilter cvs repo r1.48.2.25

287984 19-Sep-2015 cy

MFC r287651, r287652, r287653.

Fix mutex errors, fixup typos in comments.

Obtained from: NetBSD r1.4.
-This lie, anr those below, will be ignored--
> Description of fields to fill in above: 76 columns --|
> PR: If a GNATS PR is affected by the change.
> Submitted by: If someone else sent in the change.
> Reviewed by: If someone else reviewed your modification.
> Approved by: If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email.
> MFH: Ports tree branch name. Request approval for merge.
> Relnotes: Set to 'yes' for mention in release notes.
> Security: Vulnerability reference (one per line) or description.
> Sponsored by: If the change was sponsored by an organization.
> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

_M .
M sys/contrib/ipfilter/netinet/ip_state.c

275690 10-Dec-2014 cy

MFC r275199.

Correctly define constants.

275213 28-Nov-2014 cy

MFC r274744.

Set the current vnet inside the ioctl handler for ipfilter.

Without this fix, the vnet was NULL and would crash.
This fix is similar to what was done inside the ioctl handler for PF.

Tested by:
(1) Boot a kernel with "options VIMAGE" enabled
(2) Type:

echo "map lo0 from 10.0.0.0/24 to ! 10.0.0.0/24 -> 127.0.0.1/32" > /etc/ipnat.rules ; service ipnat onerestart

PR: 176992
Differential Revision: https://reviews.freebsd.org/D1191

272998 12-Oct-2014 cy

MFC r272555

ipfilter bug #537 NAT rules with sticky have incorrect hostmap IP address.
This fixes when an IP address mapping is put in the hostmap table for
sticky NAT rules, it ends up having the wrong byte order.

Obtained from: ipfilter CVS repo (r1.102), NetBSD CVS repo (r1.12)

272997 12-Oct-2014 cy

MFC r272554

ipfilter bug #534 destination list hashing not endian neutral

Obtained from: ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8)

272996 12-Oct-2014 cy

MFC r272553

ipfilter bug #538 ipf_p_dns_del should return void

Obtained from: ipfilter cvs repo (r1.8)

272995 12-Oct-2014 cy

MFC r272552

ipfilter bug #554 Determining why a ipf rule matches is hard -- replace
ipfilter rule compare with new ipf_rule_compare() function.

Obtained from: ipfilter CVS rep (r1.129)

272994 12-Oct-2014 cy

MFC r272551

ipfiler bug #550 filter rule list corrupted with inserted rules

Obtained from: ipfilter CVS repo (r1.128); NetBSD CVS repo (r1.15)

272993 12-Oct-2014 cy

MFC r272052

ipfilter bug #558 add in some missing frag table function comments.

Obtained from: ipfilter CVS repo (r1.36)

272992 12-Oct-2014 cy

MFC r271980

Check for NULL before de-refencing; in particular sel is assigned to NULL,
in the default case, and then couple of lines down we do sel->

Obtained from: NetBSD CVS repo (r1.5)

269696 08-Aug-2014 cy

MFC r269585 - Honour WITH and WITHOUT_INET6_SUPPORT.

Approved by: glebius (mentor - implicit)

268937 21-Jul-2014 cy

MFC r268532 and r268585. When world and kernel are built without INET6
support, the userland was still built with INET6 turned on.

PR: 190964
Approved by: glebius (mentor, implicit)

267868 25-Jun-2014 cy

MFC r267634: Fix case where fastroute or "to interface" is used with
incorrect FIB.

PR: 183065
Submitted by: p-freebsd-bugs@ziemba.us
Approved by: glebius (mentor)

267020 03-Jun-2014 cy

MFC r266605.

Move mutex creation from ipf_log_soft_init() to ipf_log_soft_create()
to be consistent with mutex destruction in ipf_log_soft_destroy(). As a
result mutex destruction in ipf_log_soft_fini() is redundant.

Approved by: glebius (mentor)

266829 29-May-2014 cy

MFC r264235:

Implement the final missing sysctls by moving ipf_auth_softc_t from
ip_auth.c to ip_auth.h. ip_frag_soft_t moves from ip_frag.c to
ip_frag.h. mlfk_ipl.c creates sysctl MIBs that reference control blocks
that are dynamically created when IP Filter is loaded. This necessitated
creating them on-the-fly rather than statically at compile time.

Approved by: glebius (mentor)

263478 21-Mar-2014 glebius

Merge r262763, r262767, r262771, r262806 from head:
- Remove rt_metrics_lite and simply put its members into rtentry.
- Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This
removes another cache trashing ++ from packet forwarding path.
- Create zini/fini methods for the rtentry UMA zone. Via initialize
mutex and counter in them.
- Fix reporting of rmx_pksent to routing socket.
- Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode.

259073 07-Dec-2013 peter

Hoist all the mergeinfo up to the root in preparation for enforcing merges
to the root only. All MFC's were rerecorded to the root.

Going forward, if an MFC includes mergeinfo, it will need to be made to
the root and committed from the root. Merges with --ignore-ancestry
or diff | patch can go anywhere.

The mergeinfo in HEAD is in a bad state from years of neglect and manual
tampering and this was branched into 10.x. This confuses the coalescing
code and prevents it from doing its job.

Approved by: re (gjb, implicit)


/freebsd-10-stable/MAINTAINERS
/freebsd-10-stable/Makefile.inc1
/freebsd-10-stable/ObsoleteFiles.inc
/freebsd-10-stable/UPDATING
/freebsd-10-stable/bin/df
/freebsd-10-stable/bin/freebsd-version
/freebsd-10-stable/cddl
/freebsd-10-stable/cddl/contrib/opensolaris
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-10-stable/contrib/apr
/freebsd-10-stable/contrib/apr-util
/freebsd-10-stable/contrib/atf
/freebsd-10-stable/contrib/binutils
/freebsd-10-stable/contrib/bmake
/freebsd-10-stable/contrib/byacc
/freebsd-10-stable/contrib/bzip2
/freebsd-10-stable/contrib/com_err
/freebsd-10-stable/contrib/compiler-rt
/freebsd-10-stable/contrib/dialog
/freebsd-10-stable/contrib/dtc
/freebsd-10-stable/contrib/ee
/freebsd-10-stable/contrib/expat
/freebsd-10-stable/contrib/file
/freebsd-10-stable/contrib/gcc
/freebsd-10-stable/contrib/gdb
/freebsd-10-stable/contrib/gdtoa
/freebsd-10-stable/contrib/groff
/freebsd-10-stable/contrib/ipfilter
/freebsd-10-stable/contrib/ipfilter/ml_ipl.c
/freebsd-10-stable/contrib/ipfilter/mlfk_ipl.c
/freebsd-10-stable/contrib/ipfilter/mlh_rule.c
/freebsd-10-stable/contrib/ipfilter/mli_ipl.c
/freebsd-10-stable/contrib/ipfilter/mln_ipl.c
/freebsd-10-stable/contrib/ipfilter/mls_ipl.c
/freebsd-10-stable/contrib/ldns
/freebsd-10-stable/contrib/less
/freebsd-10-stable/contrib/libarchive
/freebsd-10-stable/contrib/libarchive/cpio
/freebsd-10-stable/contrib/libarchive/libarchive
/freebsd-10-stable/contrib/libarchive/libarchive_fe
/freebsd-10-stable/contrib/libarchive/tar
/freebsd-10-stable/contrib/libc++
/freebsd-10-stable/contrib/libc-vis
/freebsd-10-stable/contrib/libcxxrt
/freebsd-10-stable/contrib/libexecinfo
/freebsd-10-stable/contrib/libpcap
/freebsd-10-stable/contrib/libstdc++
/freebsd-10-stable/contrib/llvm
/freebsd-10-stable/contrib/llvm/tools/clang
/freebsd-10-stable/contrib/mtree
/freebsd-10-stable/contrib/ncurses
/freebsd-10-stable/contrib/netcat
/freebsd-10-stable/contrib/ntp
/freebsd-10-stable/contrib/nvi
/freebsd-10-stable/contrib/one-true-awk
/freebsd-10-stable/contrib/openbsm
/freebsd-10-stable/contrib/openpam
/freebsd-10-stable/contrib/openresolv
/freebsd-10-stable/contrib/pf
/freebsd-10-stable/contrib/sendmail
/freebsd-10-stable/contrib/serf
/freebsd-10-stable/contrib/smbfs
/freebsd-10-stable/contrib/subversion
/freebsd-10-stable/contrib/tcpdump
/freebsd-10-stable/contrib/tcsh
/freebsd-10-stable/contrib/tnftp
/freebsd-10-stable/contrib/top
/freebsd-10-stable/contrib/top/install-sh
/freebsd-10-stable/contrib/tzcode/stdtime
/freebsd-10-stable/contrib/tzcode/zic
/freebsd-10-stable/contrib/tzdata
/freebsd-10-stable/contrib/unbound
/freebsd-10-stable/contrib/wpa
/freebsd-10-stable/contrib/xz
/freebsd-10-stable/crypto/heimdal
/freebsd-10-stable/crypto/openssh
/freebsd-10-stable/crypto/openssl
/freebsd-10-stable/etc
/freebsd-10-stable/etc/rc.d
/freebsd-10-stable/gnu/lib
/freebsd-10-stable/gnu/usr.bin/binutils
/freebsd-10-stable/gnu/usr.bin/cc/cc_tools
/freebsd-10-stable/gnu/usr.bin/gdb
/freebsd-10-stable/include
/freebsd-10-stable/lib
/freebsd-10-stable/lib/libc
/freebsd-10-stable/lib/libc/stdtime
/freebsd-10-stable/lib/libc_nonshared
/freebsd-10-stable/lib/libfetch
/freebsd-10-stable/lib/libiconv_modules
/freebsd-10-stable/lib/libsmb
/freebsd-10-stable/lib/libthr
/freebsd-10-stable/lib/libutil
/freebsd-10-stable/lib/libvmmapi
/freebsd-10-stable/lib/libyaml
/freebsd-10-stable/lib/libz
/freebsd-10-stable/release
/freebsd-10-stable/release/doc
/freebsd-10-stable/sbin
/freebsd-10-stable/sbin/camcontrol
/freebsd-10-stable/sbin/dumpon
/freebsd-10-stable/sbin/hastd
/freebsd-10-stable/sbin/ifconfig
/freebsd-10-stable/sbin/ipfw
/freebsd-10-stable/sbin/nvmecontrol
/freebsd-10-stable/share
/freebsd-10-stable/share/examples/bhyve
/freebsd-10-stable/share/i18n/csmapper/JIS
/freebsd-10-stable/share/i18n/esdb/EUC
/freebsd-10-stable/share/man
/freebsd-10-stable/share/man/man4
/freebsd-10-stable/share/man/man4/bhyve.4
/freebsd-10-stable/share/man/man5
/freebsd-10-stable/share/man/man7
/freebsd-10-stable/share/man/man8
/freebsd-10-stable/share/misc
/freebsd-10-stable/share/mk
/freebsd-10-stable/share/mk/bsd.arch.inc.mk
/freebsd-10-stable/share/syscons
/freebsd-10-stable/share/zoneinfo
/freebsd-10-stable/sys
/freebsd-10-stable/sys/amd64/include/vmm.h
/freebsd-10-stable/sys/amd64/include/vmm_dev.h
/freebsd-10-stable/sys/amd64/include/vmm_instruction_emul.h
/freebsd-10-stable/sys/amd64/include/xen
/freebsd-10-stable/sys/amd64/vmm
/freebsd-10-stable/sys/boot
/freebsd-10-stable/sys/boot/i386/efi
/freebsd-10-stable/sys/boot/ia64/efi
/freebsd-10-stable/sys/boot/ia64/ski
/freebsd-10-stable/sys/boot/powerpc/boot1.chrp
/freebsd-10-stable/sys/boot/powerpc/ofw
/freebsd-10-stable/sys/cddl/contrib/opensolaris
/freebsd-10-stable/sys/conf
/freebsd-10-stable/sys/contrib/dev/acpica
/freebsd-10-stable/sys/contrib/dev/acpica/changes.txt
/freebsd-10-stable/sys/contrib/dev/acpica/common
/freebsd-10-stable/sys/contrib/dev/acpica/compiler
/freebsd-10-stable/sys/contrib/dev/acpica/components/debugger
/freebsd-10-stable/sys/contrib/dev/acpica/components/disassembler
/freebsd-10-stable/sys/contrib/dev/acpica/components/dispatcher
/freebsd-10-stable/sys/contrib/dev/acpica/components/events
/freebsd-10-stable/sys/contrib/dev/acpica/components/executer
/freebsd-10-stable/sys/contrib/dev/acpica/components/hardware
/freebsd-10-stable/sys/contrib/dev/acpica/components/namespace
/freebsd-10-stable/sys/contrib/dev/acpica/components/parser
/freebsd-10-stable/sys/contrib/dev/acpica/components/resources
/freebsd-10-stable/sys/contrib/dev/acpica/components/tables
/freebsd-10-stable/sys/contrib/dev/acpica/components/utilities
/freebsd-10-stable/sys/contrib/dev/acpica/include
/freebsd-10-stable/sys/contrib/dev/acpica/os_specific
/freebsd-10-stable/sys/contrib/ipfilter
netinet/ip_fil_freebsd.c
netinet/ip_raudio_pxy.c
/freebsd-10-stable/sys/contrib/libfdt
/freebsd-10-stable/sys/contrib/octeon-sdk
/freebsd-10-stable/sys/contrib/x86emu
/freebsd-10-stable/sys/dev/bvm
/freebsd-10-stable/sys/dev/fdt/fdt_ic_if.m
/freebsd-10-stable/sys/dev/hyperv
/freebsd-10-stable/sys/modules/hyperv
/freebsd-10-stable/sys/modules/vmm
/freebsd-10-stable/sys/x86/include/acpica_machdep.h
/freebsd-10-stable/tools
/freebsd-10-stable/tools/build
/freebsd-10-stable/tools/build/options
/freebsd-10-stable/tools/tools/atsectl
/freebsd-10-stable/usr.bin/calendar
/freebsd-10-stable/usr.bin/csup
/freebsd-10-stable/usr.bin/iscsictl
/freebsd-10-stable/usr.bin/procstat
/freebsd-10-stable/usr.sbin
/freebsd-10-stable/usr.sbin/bhyve
/freebsd-10-stable/usr.sbin/bhyvectl
/freebsd-10-stable/usr.sbin/bhyveload
/freebsd-10-stable/usr.sbin/bsdconfig
/freebsd-10-stable/usr.sbin/bsdinstall
/freebsd-10-stable/usr.sbin/ctladm
/freebsd-10-stable/usr.sbin/ctld
/freebsd-10-stable/usr.sbin/freebsd-update
/freebsd-10-stable/usr.sbin/jail
/freebsd-10-stable/usr.sbin/mergemaster
/freebsd-10-stable/usr.sbin/mount_smbfs
/freebsd-10-stable/usr.sbin/ndiscvt
/freebsd-10-stable/usr.sbin/pkg
/freebsd-10-stable/usr.sbin/rtadvctl
/freebsd-10-stable/usr.sbin/rtadvd
/freebsd-10-stable/usr.sbin/rtsold
/freebsd-10-stable/usr.sbin/zic
256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256253 10-Oct-2013 dim

Initialize a variable in sys/contrib/ipfilter/netinet/ip_tftp_pxy.c, to
silence a gcc warning.

Approved by: re (rodrigc)
X-MFC-With: r255332


256199 09-Oct-2013 dim

Initialize a variable in sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c, to
silence a gcc warning.

Approved by: re (gjb)
X-MFC-With: r255332


255757 21-Sep-2013 cy

Address double init of ip_log mutex, fixing a panic after ipfilter is
re-enabled following it being disabled.

Approved by: glebius (mentor)
Approved by: re (blanket)


255756 21-Sep-2013 cy

Enable main ipfilter sysctl MIBs.

Approved by: glebius (mentor)
Approved by: re (blanket)


255755 21-Sep-2013 cy

Convert ipfilter from timeout(9) to callout(9).

Submitted by: jhb
Approved by: glebius (mentor)
Approved by: re (blanket)


255754 21-Sep-2013 cy

Remove additional non-FreeBSD code.

Approved by: glebius (mentor)
Approved by: re (blanket)


255355 07-Sep-2013 glebius

Fix !INET6 build.


255332 06-Sep-2013 cy

Update ipfilter 4.1.28 --> 5.1.2.

Approved by: glebius (mentor)
BSD Licensed by: Darren Reed <darrenr@reed.wattle.id.au> (author)


253482 20-Jul-2013 cy

As per the developers handbook (5.3.1 step 1), bootstrap svn:mergeinfo on
the ipfilter directories in the main tree to the last commit made to
the ipfilter trees in the vendor branches (r253468) which flattened the
ipfilter vendor trees.

Now that this step is complete, we are free to import new sources into the
ipfilter vendor trees.

Approved by: glebius (Mentor)


249266 08-Apr-2013 glebius

Forcibly defining _KERNEL is bad idea. Toss some code so that ip_var.h
isn't included with forced _KERNEL define.


241546 14-Oct-2012 glebius

Fix defines in r241245. We actually don't define FreeBSD.

Reported & tested by: Oleg Ginzburg


241394 10-Oct-2012 kevlo

Revert previous commit...

Pointyhat to: kevlo (myself)


241370 09-Oct-2012 kevlo

Prefer NULL over 0 for pointers


241245 06-Oct-2012 glebius

A step in resolving mess with byte ordering for AF_INET. After this change:

- All packets in NETISR_IP queue are in net byte order.
- ip_input() is entered in net byte order and converts packet
to host byte order right _after_ processing pfil(9) hooks.
- ip_output() is entered in host byte order and converts packet
to net byte order right _before_ processing pfil(9) hooks.
- ip_fragment() accepts and emits packet in net byte order.
- ip_forward(), ip_mloopback() use host byte order (untouched actually).
- ip_fastforward() no longer modifies packet at all (except ip_ttl).
- Swapping of byte order there and back removed from the following modules:
pf(4), ipfw(4), enc(4), if_bridge(4).
- Swapping of byte order added to ipfilter(4), based on __FreeBSD_version
- __FreeBSD_version bumped.
- pfil(9) manual page updated.

Reviewed by: ray, luigi, eri, melifaro
Tested by: glebius (LE), ray (BE)


241002 27-Sep-2012 fjoe

Fix pseudo checksum calculation.

This fixes ipfilter w/ network controllers that implement only
partial rx csum offloading.

PR: 106438
Obtained from: upstream
MFC after: 1 week


240725 20-Sep-2012 kevlo

Fix typo: s/pakcet/packet


227957 24-Nov-2011 rmh

Adjust a few old checks to use __FreeBSD_version macro to
determine which version of FreeBSD kernel we're compiling.

Approved by: kib (mentor)


213782 13-Oct-2010 rpaulo

Pass a format string to make_dev().

Found by: clang


207369 29-Apr-2010 bz

MFP4: @176978-176982, 176984, 176990-176994, 177441

"Whitspace" churn after the VIMAGE/VNET whirls.

Remove the need for some "init" functions within the network
stack, like pim6_init(), icmp_init() or significantly shorten
others like ip6_init() and nd6_init(), using static initialization
again where possible and formerly missed.

Move (most) variables back to the place they used to be before the
container structs and VIMAGE_GLOABLS (before r185088) and try to
reduce the diff to stable/7 and earlier as good as possible,
to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9.

This also removes some header file pollution for putatively
static global variables.

Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are
no longer needed.

Reviewed by: jhb
Discussed with: rwatson
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
MFC after: 6 days


206627 14-Apr-2010 imp

We don't need the definition for in_cksum repeated here since we get
it from machine/in_cksum.h. This definition prevents us from using
hand-tuned assembler versions of in_cksum.

# this fixes the modules build on arm for ipfilter.


196019 01-Aug-2009 rwatson

Merge the remainder of kern_vimage.c and vimage.h into vnet.c and
vnet.h, we now use jails (rather than vimages) as the abstraction
for virtualization management, and what remained was specific to
virtual network stacks. Minor cleanups are done in the process,
and comments updated to reflect these changes.

Reviewed by: bz
Approved by: re (vimage blanket)


195699 14-Jul-2009 rwatson

Build on Jeff Roberson's linker-set based dynamic per-CPU allocator
(DPCPU), as suggested by Peter Wemm, and implement a new per-virtual
network stack memory allocator. Modify vnet to use the allocator
instead of monolithic global container structures (vinet, ...). This
change solves many binary compatibility problems associated with
VIMAGE, and restores ELF symbols for virtualized global variables.

Each virtualized global variable exists as a "reference copy", and also
once per virtual network stack. Virtualized global variables are
tagged at compile-time, placing the in a special linker set, which is
loaded into a contiguous region of kernel memory. Virtualized global
variables in the base kernel are linked as normal, but those in modules
are copied and relocated to a reserved portion of the kernel's vnet
region with the help of a the kernel linker.

Virtualized global variables exist in per-vnet memory set up when the
network stack instance is created, and are initialized statically from
the reference copy. Run-time access occurs via an accessor macro, which
converts from the current vnet and requested symbol to a per-vnet
address. When "options VIMAGE" is not compiled into the kernel, normal
global ELF symbols will be used instead and indirection is avoided.

This change restores static initialization for network stack global
variables, restores support for non-global symbols and types, eliminates
the need for many subsystem constructors, eliminates large per-subsystem
structures that caused many binary compatibility issues both for
monitoring applications (netstat) and kernel modules, removes the
per-function INIT_VNET_*() macros throughout the stack, eliminates the
need for vnet_symmap ksym(2) munging, and eliminates duplicate
definitions of virtualized globals under VIMAGE_GLOBALS.

Bump __FreeBSD_version and update UPDATING.

Portions submitted by: bz
Reviewed by: bz, zec
Discussed with: gnn, jamie, jeff, jhb, julian, sam
Suggested by: peter
Approved by: re (kensmith)


192895 27-May-2009 jamie

Add hierarchical jails. A jail may further virtualize its environment
by creating a child jail, which is visible to that jail and to any
parent jails. Child jails may be restricted more than their parents,
but never less. Jail names reflect this hierarchy, being MIB-style
dot-separated strings.

Every thread now points to a jail, the default being prison0, which
contains information about the physical system. Prison0's root
directory is the same as rootvnode; its hostname is the same as the
global hostname, and its securelevel replaces the global securelevel.
Note that the variable "securelevel" has actually gone away, which
should not cause any problems for code that properly uses
securelevel_gt() and securelevel_ge().

Some jail-related permissions that were kept in global variables and
set via sysctls are now per-jail settings. The sysctls still exist for
backward compatibility, used only by the now-deprecated jail(2) system
call.

Approved by: bz (mentor)


191548 26-Apr-2009 zec

In preparation for turning on options VIMAGE in next commits,
rearrange / replace / adjust several INIT_VNET_* initializer
macros, all of which currently resolve to whitespace.

Reviewed by: bz (an older version of the patch)
Approved by: julian (mentor)


191148 16-Apr-2009 kmacy

Change if_output to take a struct route as its fourth argument in order
to allow passing a cached struct llentry * down to L2

Reviewed by: rwatson


189105 27-Feb-2009 bz

Move the include of vinet.h further up before the ipfilter includes.


186436 23-Dec-2008 bz

Check for ipprotosw.h more precisely.
It hasn't been needed for more than 5 years, since r120386.

MFC after: 4 weeks


185571 02-Dec-2008 bz

Rather than using hidden includes (with cicular dependencies),
directly include only the header files needed. This reduces the
unneeded spamming of various headers into lots of files.

For now, this leaves us with very few modules including vnet.h
and thus needing to depend on opt_route.h.

Reviewed by: brooks, gnn, des, zec, imp
Sponsored by: The FreeBSD Foundation


185419 28-Nov-2008 zec

Unhide declarations of network stack virtualization structs from
underneath #ifdef VIMAGE blocks.

This change introduces some churn in #include ordering and nesting
throughout the network stack and drivers but is not expected to cause
any additional issues.

In the next step this will allow us to instantiate the virtualization
container structures and switch from using global variables to their
"containerized" counterparts.

Reviewed by: bz, julian
Approved by: julian (mentor)
Obtained from: //depot/projects/vimage-commit2/...
X-MFC after: never
Sponsored by: NLnet Foundation, The FreeBSD Foundation


184205 23-Oct-2008 des

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months


183550 02-Oct-2008 zec

Step 1.5 of importing the network stack virtualization infrastructure
from the vimage project, as per plan established at devsummit 08/08:
http://wiki.freebsd.org/Image/Notes200808DevSummit

Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator
macros, and CURVNET_SET() context setting macros, all currently
resolving to NOPs.

Prepare for virtualization of selected SYSCTL objects by introducing a
family of SYSCTL_V_*() macros, currently resolving to their global
counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT().

Move selected #defines from sys/sys/vimage.h to newly introduced header
files specific to virtualized subsystems (sys/net/vnet.h,
sys/netinet/vinet.h etc.).

All the changes are verified to have zero functional impact at this
point in time by doing MD5 comparision between pre- and post-change
object files(*).

(*) netipsec/keysock.c did not validate depending on compile time options.

Implemented by: julian, bz, brooks, zec
Reviewed by: julian, bz, brooks, kris, rwatson, ...
Approved by: julian (mentor)
Obtained from: //depot/projects/vimage-commit2/...
X-MFC after: never
Sponsored by: NLnet Foundation, The FreeBSD Foundation


183397 27-Sep-2008 ed

Replace all calls to minor() with dev2unit().

After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by: kib


181803 17-Aug-2008 bz

Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).

This is the first in a series of commits over the course
of the next few weeks.

Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.

We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.

Obtained from: //depot/projects/vimage-commit2/...
Reviewed by: brooks, des, ed, mav, julian,
jamie, kris, rwatson, zec, ...
(various people I forgot, different versions)
md5 (with a bit of help)
Sponsored by: NLnet Foundation, The FreeBSD Foundation
X-MFC after: never
V_Commit_Message_Reviewed_By: more people than the patch


180832 26-Jul-2008 darrenr

2020447 IPFilter's NAT can undo name server random port selection
(fix output port range, was a random number in [0,max-min]
(byteswapped on litle endian), instead of [min,max])

Submitted by: darrenr


180778 24-Jul-2008 darrenr

2020447 IPFilter's NAT can undo name server random port selection

Approved by: darrenr
MFC after: 1 week
Security: CERT VU#521769


178888 09-May-2008 julian

Add code to allow the system to handle multiple routing tables.
This particular implementation is designed to be fully backwards compatible
and to be MFC-able to 7.x (and 6.x)

Currently the only protocol that can make use of the multiple tables is IPv4
Similar functionality exists in OpenBSD and Linux.

From my notes:

-----

One thing where FreeBSD has been falling behind, and which by chance I
have some time to work on is "policy based routing", which allows
different
packet streams to be routed by more than just the destination address.

Constraints:
------------

I want to make some form of this available in the 6.x tree
(and by extension 7.x) , but FreeBSD in general needs it so I might as
well do it in -current and back port the portions I need.

One of the ways that this can be done is to have the ability to
instantiate multiple kernel routing tables (which I will now
refer to as "Forwarding Information Bases" or "FIBs" for political
correctness reasons). Which FIB a particular packet uses to make
the next hop decision can be decided by a number of mechanisms.
The policies these mechanisms implement are the "Policies" referred
to in "Policy based routing".

One of the constraints I have if I try to back port this work to
6.x is that it must be implemented as a EXTENSION to the existing
ABIs in 6.x so that third party applications do not need to be
recompiled in timespan of the branch.

This first version will not have some of the bells and whistles that
will come with later versions. It will, for example, be limited to 16
tables in the first commit.
Implementation method, Compatible version. (part 1)
-------------------------------
For this reason I have implemented a "sufficient subset" of a
multiple routing table solution in Perforce, and back-ported it
to 6.x. (also in Perforce though not always caught up with what I
have done in -current/P4). The subset allows a number of FIBs
to be defined at compile time (8 is sufficient for my purposes in 6.x)
and implements the changes needed to allow IPV4 to use them. I have not
done the changes for ipv6 simply because I do not need it, and I do not
have enough knowledge of ipv6 (e.g. neighbor discovery) needed to do it.

Other protocol families are left untouched and should there be
users with proprietary protocol families, they should continue to work
and be oblivious to the existence of the extra FIBs.

To understand how this is done, one must know that the current FIB
code starts everything off with a single dimensional array of
pointers to FIB head structures (One per protocol family), each of
which in turn points to the trie of routes available to that family.

The basic change in the ABI compatible version of the change is to
extent that array to be a 2 dimensional array, so that
instead of protocol family X looking at rt_tables[X] for the
table it needs, it looks at rt_tables[Y][X] when for all
protocol families except ipv4 Y is always 0.
Code that is unaware of the change always just sees the first row
of the table, which of course looks just like the one dimensional
array that existed before.

The entry points rtrequest(), rtalloc(), rtalloc1(), rtalloc_ign()
are all maintained, but refer only to the first row of the array,
so that existing callers in proprietary protocols can continue to
do the "right thing".
Some new entry points are added, for the exclusive use of ipv4 code
called in_rtrequest(), in_rtalloc(), in_rtalloc1() and in_rtalloc_ign(),
which have an extra argument which refers the code to the correct row.

In addition, there are some new entry points (currently called
rtalloc_fib() and friends) that check the Address family being
looked up and call either rtalloc() (and friends) if the protocol
is not IPv4 forcing the action to row 0 or to the appropriate row
if it IS IPv4 (and that info is available). These are for calling
from code that is not specific to any particular protocol. The way
these are implemented would change in the non ABI preserving code
to be added later.

One feature of the first version of the code is that for ipv4,
the interface routes show up automatically on all the FIBs, so
that no matter what FIB you select you always have the basic
direct attached hosts available to you. (rtinit() does this
automatically).

You CAN delete an interface route from one FIB should you want
to but by default it's there. ARP information is also available
in each FIB. It's assumed that the same machine would have the
same MAC address, regardless of which FIB you are using to get
to it.

This brings us as to how the correct FIB is selected for an outgoing
IPV4 packet.

Firstly, all packets have a FIB associated with them. if nothing
has been done to change it, it will be FIB 0. The FIB is changed
in the following ways.

Packets fall into one of a number of classes.

1/ locally generated packets, coming from a socket/PCB.
Such packets select a FIB from a number associated with the
socket/PCB. This in turn is inherited from the process,
but can be changed by a socket option. The process in turn
inherits it on fork. I have written a utility call setfib
that acts a bit like nice..

setfib -3 ping target.example.com # will use fib 3 for ping.

It is an obvious extension to make it a property of a jail
but I have not done so. It can be achieved by combining the setfib and
jail commands.

2/ packets received on an interface for forwarding.
By default these packets would use table 0,
(or possibly a number settable in a sysctl(not yet)).
but prior to routing the firewall can inspect them (see below).
(possibly in the future you may be able to associate a FIB
with packets received on an interface.. An ifconfig arg, but not yet.)

3/ packets inspected by a packet classifier, which can arbitrarily
associate a fib with it on a packet by packet basis.
A fib assigned to a packet by a packet classifier
(such as ipfw) would over-ride a fib associated by
a more default source. (such as cases 1 or 2).

4/ a tcp listen socket associated with a fib will generate
accept sockets that are associated with that same fib.

5/ Packets generated in response to some other packet (e.g. reset
or icmp packets). These should use the FIB associated with the
packet being reponded to.

6/ Packets generated during encapsulation.
gif, tun and other tunnel interfaces will encapsulate using the FIB
that was in effect withthe proces that set up the tunnel.
thus setfib 1 ifconfig gif0 [tunnel instructions]
will set the fib for the tunnel to use to be fib 1.

Routing messages would be associated with their
process, and thus select one FIB or another.
messages from the kernel would be associated with the fib they
refer to and would only be received by a routing socket associated
with that fib. (not yet implemented)

In addition Netstat has been edited to be able to cope with the
fact that the array is now 2 dimensional. (It looks in system
memory using libkvm (!)). Old versions of netstat see only the first FIB.

In addition two sysctls are added to give:
a) the number of FIBs compiled in (active)
b) the default FIB of the calling process.

Early testing experience:
-------------------------

Basically our (IronPort's) appliance does this functionality already
using ipfw fwd but that method has some drawbacks.

For example,
It can't fully simulate a routing table because it can't influence the
socket's choice of local address when a connect() is done.

Testing during the generating of these changes has been
remarkably smooth so far. Multiple tables have co-existed
with no notable side effects, and packets have been routes
accordingly.

ipfw has grown 2 new keywords:

setfib N ip from anay to any
count ip from any to any fib N

In pf there seems to be a requirement to be able to give symbolic names to the
fibs but I do not have that capacity. I am not sure if it is required.

SCTP has interestingly enough built in support for this, called VRFs
in Cisco parlance. it will be interesting to see how that handles it
when it suddenly actually does something.

Where to next:
--------------------

After committing the ABI compatible version and MFCing it, I'd
like to proceed in a forward direction in -current. this will
result in some roto-tilling in the routing code.

Firstly: the current code's idea of having a separate tree per
protocol family, all of the same format, and pointed to by the
1 dimensional array is a bit silly. Especially when one considers that
there is code that makes assumptions about every protocol having the
same internal structures there. Some protocols don't WANT that
sort of structure. (for example the whole idea of a netmask is foreign
to appletalk). This needs to be made opaque to the external code.

My suggested first change is to add routing method pointers to the
'domain' structure, along with information pointing the data.
instead of having an array of pointers to uniform structures,
there would be an array pointing to the 'domain' structures
for each protocol address domain (protocol family),
and the methods this reached would be called. The methods would have
an argument that gives FIB number, but the protocol would be free
to ignore it.

When the ABI can be changed it raises the possibilty of the
addition of a fib entry into the "struct route". Currently,
the structure contains the sockaddr of the desination, and the resulting
fib entry. To make this work fully, one could add a fib number
so that given an address and a fib, one can find the third element, the
fib entry.

Interaction with the ARP layer/ LL layer would need to be
revisited as well. Qing Li has been working on this already.

This work was sponsored by Ironport Systems/Cisco

Reviewed by: several including rwatson, bz and mlair (parts each)
Obtained from: Ironport systems/Cisco


173931 26-Nov-2007 darrenr

Fix 3 issues relating to the use of "auth" rules in IPFilter, from sourceforge:
1837014 Kernel panics after authentication of an outgoing packet
1836992 Potential bugs in packet auth code (w/patches)
1836967 Kernel panic when using auth rule with keep state
and another reported only to FreeBSD by Andiry (see PR)

PR: kern/118251
Submitted by: Andriy Syrovenko <andriys@gmail.com>
Reviewed by: darrenr
MFC after: 5 days


173181 30-Oct-2007 darrenr

Apply a few changes from ipfilter-current:
* Do not hold any locks over calls to copyin/copyout.
* Clean up some #ifdefs
* fix a possible mbuf leak when NAT fails on policy routed packets

PR: 117216


172776 18-Oct-2007 darrenr

Pullup IPFilter 4.1.28 from the vendor branch into HEAD.

MFC after: 7 days


172772 18-Oct-2007 darrenr

This commit was generated by cvs2svn to compensate for changes in r172771,
which included commits to RCS files with non-trunk default branches.


170459 09-Jun-2007 darrenr

Pointer to an ICMP header was getting left behind after doing a pullup.


170268 04-Jun-2007 darrenr

Merge IPFilter 4.1.23 back to HEAD
See src/contrib/ipfilter/HISTORY for details of changes since 4.1.13


170264 04-Jun-2007 darrenr

This commit was generated by cvs2svn to compensate for changes in r170263,
which included commits to RCS files with non-trunk default branches.


165515 24-Dec-2006 darrenr

TCP Window scaling was being recognised but the recorded settings were being
clobbered and thus effectively disabled.

MFC after: 7 days


163027 05-Oct-2006 oleg

Workaround bad locking design:
do not try to lock/unlock destroyed/non-existsing mutex.

PR: kern/103569
Reviewed by: guido
Approved by: glebius (mentor)
Silence from: darrenr
MFC: 2 week


161356 16-Aug-2006 guido

Resolve conflicts

MFC after: 2 weeks


161352 16-Aug-2006 guido

This commit was generated by cvs2svn to compensate for changes in r161351,
which included commits to RCS files with non-trunk default branches.


157836 18-Apr-2006 darrenr

fix "ipf -Z" reporting rubbish and possibly panic'ing box

MFC after: 4 days


153882 30-Dec-2005 guido

Add mcopywrap prototype to ip_compat.h
Remove h323 proxy from ip_proxy (copyright issue)


153876 30-Dec-2005 guido

Resolve conflicts


153873 30-Dec-2005 guido

This commit was generated by cvs2svn to compensate for changes in r153872,
which included commits to RCS files with non-trunk default branches.


153084 04-Dec-2005 ru

Fix -Wundef from compiling the amd64 LINT.


151897 31-Oct-2005 rwatson

Normalize a significant number of kernel malloc type names:

- Prefer '_' to ' ', as it results in more easily parsed results in
memory monitoring tools such as vmstat.

- Remove punctuation that is incompatible with using memory type names
as file names, such as '/' characters.

- Disambiguate some collisions by adding subsystem prefixes to some
memory types.

- Generally prefer lower case to upper case.

- If the same type is defined in multiple architecture directories,
attempt to use the same name in additional cases.

Not all instances were caught in this change, so more work is required to
finish this conversion. Similar changes are required for UMA zone names.


147547 23-Jun-2005 darrenr

Fix some minor problems before release:
(1) "ipf -T" is broken for fetching single entries and
(2) loading rules with numbered collections does not order insertion right.
(3) stats aren't accumulated for hash table memory failures

Approved by: re (dwhite)


147367 14-Jun-2005 darrenr

locking on exit of reading from ip_sync is not correct for all instances

Approved by: re (dwhite)


146277 16-May-2005 darrenr

Enable building /sbin/ipf (but not the rescue version) with the ability to
parse bpf strings for filter rules in ipf.conf


146229 15-May-2005 darrenr

Enable IPFilter to correctly determine if BPF has been optioned into the
kernel it is being compiled against and subsequently enable using BPF for
packet matching in ipf rules.


145660 29-Apr-2005 ru

Fix the following warnings on amd64:

/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_newfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:397: warning: cast to pointer from integer of different size
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_knownfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:582: warning: cast from pointer to integer of different size


145640 28-Apr-2005 darrenr

Don't use quad_t on FreeBSD (deprecated) so use "long long" instead.
Someday this should be converted to uint64_t and printstate.c changed to
use those horrid PRiud64 things.


145582 27-Apr-2005 darrenr

The current H.323 proxy source has a license that isn't suitable for inclusion
with FreeBSD so we shouldn't be trying to include it here.


145579 27-Apr-2005 darrenr

- Comment out duplicate rcsid strings in *.c files
- Move SIOCPROXY from ip_nat.h to ip_proxy.h and fix ip_proxy.h so that it
can be easily compiled into kdump, et al.


145562 26-Apr-2005 darrenr

Add an include for netinet/ip_compat.h directly so that we don't need to
add another special file in the creation of ioctls.c for kdump.


145522 25-Apr-2005 darrenr

Merge the changes from 3.4.35 to 4.1.8 into the kernel source tree


145517 25-Apr-2005 darrenr

This commit was generated by cvs2svn to compensate for changes in r145516,
which included commits to RCS files with non-trunk default branches.


142720 27-Feb-2005 phk

Use dynamic major number allocation.


139894 08-Jan-2005 darrenr

Elminate 1 LOR (actually a recursive mutex grab) involving ipfilter where
we loop through all the list of NICs (struct ifnet), holding the lock on
it and then do a name lookup with ifunit() whilst holding it.


139327 26-Dec-2004 darrenr

* Remove some code that's in a #ifndef FreeBSD that's no longer used.


139326 26-Dec-2004 darrenr

* The #ifdef's to cause mutex's for freebsd to be declared were meant to pick
up on USE_MUTEX being defined, but this patch
* Remove some code that's in a #ifndef FreeBSD that's no longer used.


139284 25-Dec-2004 scottl

Darnit, through a maze of twisty passages, ipfilter needs to have PFIL_HOOKS
defined. Revert part of the previous commit to fix this.


139282 25-Dec-2004 scottl

Sprinkle in some __FreeBSD_version checks so that this compiles again. Don't
define PFIL_HOOKS anymore.

Submitted by: keramida


139255 24-Dec-2004 darrenr

Enable fine grained locking within IPFilter, using mtx(9) and sx(9) allowing
the the "needs giant" flag to be removed from the driver.


139005 18-Dec-2004 mlaier

Make ip_nat compile again. Should read #if->n<-def LARGE_NAT as in ipf 4.x


138979 17-Dec-2004 darrenr

Move two variables that are unused if LARGE_NAT is defined inside an #ifdef
to keep them out of harms way when compiling.

PR: 72783


138947 17-Dec-2004 darrenr

Allow ipnat redirect rules to work for non-TCP/UDP packets.

PR: 70038
Submitted by: fming@borderware.com
Reviewed by: darrenr
Obtained from: fming@borderware.com


138928 16-Dec-2004 darrenr

Using just m_pullup to get all of the interesting bits in packet into one
buffer doesn't work for ipv6 packets, so use m_defrag() here instead as an
easy drop-in replacement.

PR: 70399


135920 29-Sep-2004 mlaier

Add an additional struct inpcb * argument to pfil(9) in order to enable
passing along socket information. This is required to work around a LOR with
the socket code which results in an easy reproducible hard lockup with
debug.mpsafenet=1. This commit does *not* fix the LOR, but enables us to do
so later. The missing piece is to turn the filter locking into a leaf lock
and will follow in a seperate (later) commit.

This will hopefully be MT5'ed in order to fix the problem for RELENG_5 in
forseeable future.

Suggested by: rwatson
A lot of work by: csjp (he'd be even more helpful w/o mentor-reviews ;)
Reviewed by: rwatson, csjp
Tested by: -pf, -ipfw, LINT, csjp and myself
MFC after: 3 days

LOR IDs: 14 - 17 (not fixed yet)


134402 27-Aug-2004 andre

From __FreeBSD_version 600001 on PFIL_HOOKS is permanently in the kernel and
doesn't require to include opt_pfil_hooks.h.


131974 11-Jul-2004 darrenr

Clean up a bunch of white-space difference with IPFilter source as well as
remove some superfluous assignments for .d_version/.d_flags in a cdevsw
structure initialisation that never sees the light of day in FreeBSD.


131262 29-Jun-2004 darrenr

Mess from update & merge - don't release the ifnet lock twice, just once
and after we're finished with it.


130911 22-Jun-2004 darrenr

revert section of code that calls netisr_queue() to match v1.33 of this file


130910 22-Jun-2004 darrenr

#ifdef's for FreeBSD are wrong, causing too many variable declaractions to
disappear.


130898 22-Jun-2004 darrenr

one too many #endif's from the update broke the build


130886 21-Jun-2004 darrenr

Update ipfilter from 3.4.31 -> 3.4.35. Some important changes:
* block packets that fail to create state table entries
* only allow non-fragmented packets to influence whether or not a logged
packet is the same as the one logged before.
* correct the ICMP packet checksum fixing up when processing ICMP errors for NAT
* implement a maximum for the number of entries in the NAT table (NAT_TABLE_MAX
and ipf_nattable_max)
* frsynclist() wasn't paying attention to all the places where interface
names are, like it should.
* fix comparing ICMP packets with established TCP state where only 8 bytes
of header are returned in the ICMP error.

MFC after: 1 week


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


130253 08-Jun-2004 darrenr

Recognise NOINET6 as an indication to not build IPv6 enabled source even
if FreeBSD header files, etc, support it.

Submitted by: Sergey Mokryshev <mokr@mokr.net>


128019 07-Apr-2004 imp

Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


123108 02-Dec-2003 brooks

Use parens more reasionably so we match the vendor code. This is part
of the if_xname change.

Submitted by: darrenr
Approved by: re (scottl)


121816 31-Oct-2003 brooks

Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)


121170 17-Oct-2003 ume

use ND_IFINFO().


120399 24-Sep-2003 sam

o remove extraneous include of <net/pfil.h>
o guard wrapper code against user-mode compilation

Sponsored by: FreeBSD Foundation


120387 23-Sep-2003 sam

update to reflect PFIL_HOOKS api changes

Supported by: FreeBSD Foundation


113799 21-Apr-2003 obrien

Explicitly declare 'int' parameters.


111888 04-Mar-2003 jlemon

Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point. Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs


111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


110921 15-Feb-2003 darrenr

fix bug in updating of interface pointers when resyncing state


110916 15-Feb-2003 darrenr

Commit import changed from vendor branch of ipfilter to -current head


110915 15-Feb-2003 darrenr

Commit import changed from vendor branch of ipfilter to -current head


110914 15-Feb-2003 darrenr

sometimes i hate it when you leave temp files in a directory you import from


110912 15-Feb-2003 darrenr

This commit was generated by cvs2svn to compensate for changes in r110911,
which included commits to RCS files with non-trunk default branches.


110232 02-Feb-2003 alfred

Consolidate MIN/MAX macros into one place (param.h).

Submitted by: Hiten Pandya <hiten@unixdaemons.com>


109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


108172 22-Dec-2002 hsu

SMP locking for ifnet list.


105194 16-Oct-2002 sam

Replace aux mbufs with packet tags:

o instead of a list of mbufs use a list of m_tag structures a la openbsd
o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit
ABI/module number cookie
o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and
use this in defining openbsd-compatible m_tag_find and m_tag_get routines
o rewrite KAME use of aux mbufs in terms of packet tags
o eliminate the most heavily used aux mbufs by adding an additional struct
inpcb parameter to ip_output and ip6_output to allow the IPsec code to
locate the security policy to apply to outbound packets
o bump __FreeBSD_version so code can be conditionalized
o fixup ipfilter's call to ip_output based on __FreeBSD_version

Reviewed by: julian, luigi (silent), -arch, -net, darren
Approved by: julian, silence from everyone else
Obtained from: openbsd (mostly)
MFC after: 1 month


102520 28-Aug-2002 darrenr

Finally merge in the changes from ipfilter 3.4.29 to freebsd-current.
Main changes here are related to the ftp proxy and making that work better.


102326 23-Aug-2002 archie

Don't use "NULL" when "0" is really meant.
But in this case, "-1" is really meant.

Reviewed by: darrenr


98004 07-Jun-2002 darrenr

Commit changes that happened in IPFilter versions 3.4.27 - 3.4.28


95563 27-Apr-2002 darrenr

Merge updates from 3.4.26 - 3.4.27.


95418 25-Apr-2002 darrenr

bring in changes from 3.4.26.


95416 25-Apr-2002 darrenr

This commit was generated by cvs2svn to compensate for changes in r95415,
which included commits to RCS files with non-trunk default branches.


93224 26-Mar-2002 ru

We don't need ip_ipsec_pxy.c in userland.


92703 19-Mar-2002 darrenr

do not include the missing ip_h323_pxy.c


92685 19-Mar-2002 darrenr

fix conflicts (mostly damn rcs id's) generated by import


92684 19-Mar-2002 darrenr

This file is being removed pending the all clear on its licence by someone
else.


92681 19-Mar-2002 darrenr

This commit was generated by cvs2svn to compensate for changes in r92680,
which included commits to RCS files with non-trunk default branches.


91478 28-Feb-2002 mike

Change two occurrences of HTONS() to use htons().


91441 27-Feb-2002 peter

Fix warning (unused variable)

Submitted by: LINT, -Werror


89336 14-Jan-2002 alfred

Backout inclusion of queue.h since rev 1.38 sys/file.h now has it
included in the right order.


89316 13-Jan-2002 alfred

Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.

Requested by: jhb


88876 04-Jan-2002 darrenr

Import this patch to address user concerns.

PR: 27615
Submitted by: Andria Thomas <andria@tovaris.com>
Approved by: Me.
MFC after: 7 days


87394 05-Dec-2001 guido

Fix initialisation of struct nat entry, to solve a panic that occurs
when reloading a nat table after reboot

Submitted by: Arjan de Vet <devet@devet.org>
Reviewed by: IP Filter mailing list
MFC after: 3 days


83380 12-Sep-2001 darrenr

IPFilter munges multicast address packets on the loopback interface.

Submitted by: Frank Zolf
Approved by: jkh
MFC after: 0


83377 12-Sep-2001 darrenr

Add IPFLITER.LICENCE to the kernel (requested by rwatson)


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


80625 30-Jul-2001 darrenr

fix import/merge related code problems


80482 28-Jul-2001 darrenr

fix conflicts created by import


75262 06-Apr-2001 darrenr

fix security hole created by fragment cache


74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


72010 04-Feb-2001 darrenr

fix duplicate rcsid


72006 04-Feb-2001 darrenr

fix conflicts


69152 25-Nov-2000 jlemon

Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue. Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue. An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.


68619 11-Nov-2000 bmilekic

While I'm here, get rid of (now useless) MCLISREFERENCED and use MEXT_IS_REF
instead.
Also, fix a small set of "avail." If we're setting `avail,' we shouldn't
be re-checking whether m_flags is M_EXT, because we know that it is, as if
it wasn't, we would have already returned several lines above.

Reviewed by: jlemon


67853 29-Oct-2000 darrenr

Fix conflicts creted by import.


67711 27-Oct-2000 obrien

Include sys/param.h for `__FreeBSD_version' rather than the non-existent
osreldate.h.

Submitted by: dougb


67614 26-Oct-2000 darrenr

fix conflicts from rcsids


67564 25-Oct-2000 ru

We now keep the ip_id field in network byte order all the
time, so there is no need to make the distinction between
ip_output() and ip_input() cases.

Reviewed by: silence on freebsd-net


67287 18-Oct-2000 ru

If we do not byte-swap the ip_id in the first place, don't do it in
the second. NetBSD (from where I've taken this originally) needs
to fix this too.


65837 14-Sep-2000 ru

Follow BSD/OS and NetBSD, keep the ip_id field in network order all the time.

Requested by: wollman


64580 13-Aug-2000 darrenr

resolve conflicts


64105 01-Aug-2000 roberto

Change __FreeBSD_Version into the proper __FreeBSD_version.

Submitted by: Alain.Thivillon@hsc.fr (Alain Thivillon) (for ip_fil.c)


64078 01-Aug-2000 ache

Add missing '0' to FreeBSD_version test: 50011 -> 500011


64060 31-Jul-2000 darrenr

activate pfil_hooks and covert ipfilter to use it


63523 19-Jul-2000 darrenr

fix conflicts


60944 26-May-2000 darrenr

define CSUM_DELAY_DATA to match merge


60925 25-May-2000 darrenr

fix up #ifdef jungle for FreeBSD


60923 25-May-2000 darrenr

remove duplicate prototypes


60883 24-May-2000 darrenr

fix duplicate rcsid's


60865 24-May-2000 peter

It would have been nice if this actually compiled. Close the header
comment */.


60857 24-May-2000 darrenr

fix up conflicts


60855 24-May-2000 darrenr

fix conflicts


60854 24-May-2000 darrenr

fix conflicts


60853 24-May-2000 darrenr

fix conflicts


60852 24-May-2000 darrenr

fix conflicts


60851 24-May-2000 darrenr

fix conflicts


60850 24-May-2000 darrenr

fix conflicts


60765 21-May-2000 jlemon

Compute the checksum before handing the packet off to IPFilter.

Tested by: Cy Schubert <Cy.Schubert@uumail.gov.bc.ca>


60295 09-May-2000 darrenr

Fix bug in dealing with "hlen == 1 and opt > 1"


60265 09-May-2000 ps

Add missing include machine/in_cksum.h.

Submitted by: n_hibma


59874 01-May-2000 peter

Add $FreeBSD$


57126 10-Feb-2000 guido

Re add rev 1.11 diffs to ip_fil.h Also discover that I did not undefine
CVS_FUBAR (which no longer exists) and thus forgot to add $FreeBSD's.
Add them.

Approved by: jkh (is part of ipfilter upgrade)


57096 09-Feb-2000 guido

Bring over ipfilter v3_3_8 kernel sources, including merging the
local modifications.
Also fix initializing fr_running in KLD case.
Rename ipl_inited to fr_runninhg in mlfk_ipl

Approved by: jkh


55990 14-Jan-2000 guido

Apply patches in rev 1.2 and 1.9 that I forgot

Pointe out by: bde


55929 13-Jan-2000 guido

Bring over ipfilter kernel sources, including merging the local modifications.


55460 05-Jan-2000 eivind

KERNEL -> _KERNEL


54892 20-Dec-1999 peter

The ipfilter module name wasn't exactly conventional..


54228 06-Dec-1999 guido

Last minute patch that I forgot to apply: check return code of iplattach()


54221 06-Dec-1999 guido

Revive mlfk_ipl here. This version is slightly changed from
the old one: an unnecessary define (KLD_MODULE) has been deleted and
the initialisation of the module is done after domaininit was called
to be sure inet is running.

Some slight changed were made to ip_auth.c and ip_state.c in order
to assure including of sys/systm.h in case we make a kld

Make sure ip_fil does nmot include osreldate in kernel mode

Remove mlfk_ipl.c from here: no sources allowed in these directories!


53645 23-Nov-1999 guido

Get rid of useless osreldate include for KLD/LKM modules (sys/param.h
already carries what is needed).
This is needed for the KLD support.


53642 23-Nov-1999 guido

Add kernel parts of revived ipfilter (3.3.3.)