mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 13:15:12 +02:00
bf1ca298ae608883a5c108cdb2dfd8cc8525ccb6

The Perl script that builds the GeoIP DBs uses inet_pton(3) to convert
the addresses to network byte order. This converts
"1234:5678::90ab:cdef"
to:
0x12 0x34 0x56 0x78 .. 0xcd 0xef, interpreted by an LE machine
accessing this in uint32_t-sized chunks as
8765:4321::fedc:ba09
The kernel module compares the addresses in packets with the ranges from
the DB in host byte order using binary search. It uses 32-bit swaps
when converting the addresses.
libxt_geoip, however, which the module uses to load the ranges from the
DB and convert them from NBO to HBO, uses 16-bit swaps to do so, and
this means that:
1234:5678::90ab:cdef
becomes:
4321:8765::ba09:fedc
Obviously, this is inconsistent with the kernel module and DB build
script and breaks the binary search.
Fixes: b91dbd03c7
("geoip: store database in network byte order")
Reported-by: "Thomas B. Clark" <kernel@clark.bz>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Xtables-addons ============== Xtables-addons is a set of extensions that were not accepted in the Linux kernel and/or main Xtables/iptables package. It superseded the earlier patch-o-matic(-ng) package in that no patching and/or recompilation of either the kernel or Xtables/iptables is required. However, do see the INSTALL file for the minimum requirements of Xtables-addons. Included in this package ======================== - xt_ACCOUNT 1.16, libxt_ACCOUNT 1.3
Languages
C
83.9%
Roff
10.7%
Perl
2.5%
Makefile
2%
M4
0.6%
Other
0.3%