]> git.ipfire.org Git - thirdparty/iptables.git/commit
libxtables: Simplify pending extension registration
authorPhil Sutter <phil@nwl.cc>
Fri, 18 Sep 2020 16:48:14 +0000 (18:48 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 7 Oct 2020 10:38:35 +0000 (12:38 +0200)
commita1eaaceb0460b338294e40bdd5bc5186320a478c
tree5928e158c47f05dc9b08a57e3e7053d2ee1943fd
parentb3ac87038f4e45141831d9ab485a2f627daba3f1
libxtables: Simplify pending extension registration

Assuming that pending extensions are sorted by first name and family,
then descending revision, the decision where to insert a newly
registered extension may be simplified by memorizing the previous
registration (which obviously is of same name and family and higher
revision).

As a side-effect, fix for unsupported old extension revisions lingering
in pending extension list forever and being retried with every use of
the given extension. Any revision being rejected by the kernel may
safely be dropped iff a previous (read: higher) revision was accepted
already.

Yet another side-effect of this change is the removal of an unwanted
recursion by xtables_fully_register_pending_*() into itself via
xtables_find_*().

Signed-off-by: Phil Sutter <phil@nwl.cc>
libxtables/xtables.c