]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r312787:
authorcy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 25 Feb 2017 08:07:28 +0000 (08:07 +0000)
committercy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 25 Feb 2017 08:07:28 +0000 (08:07 +0000)
commit4ac67d1462fdb3897244b3a5b4d47728cfa603e8
tree32a817c4b491d5b1a3fba7bba00834200d39b43d
parentcf36515d0f3e9f84d4dcd57f0ad052b1c7690820
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@314251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/ipfilter/lib/rwlock_emul.c
sys/contrib/ipfilter/netinet/ip_compat.h
sys/contrib/ipfilter/netinet/ip_frag.c