Files
xtables-addons/extensions
Jeremy Sowden bf1ca298ae xt_geoip: fix in6_addr little-endian byte swapping
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>
2019-12-01 11:29:40 +01:00
..
2019-05-07 03:24:43 +08:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2012-11-12 19:01:14 +01:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2012-11-12 19:01:14 +01:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2019-09-06 10:34:35 +02:00
2019-09-06 10:34:35 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2013-06-02 16:53:56 +02:00
2009-03-19 11:05:26 +01:00
2010-12-30 08:36:15 +01:00
2019-05-07 03:24:43 +08:00
2018-02-12 14:59:44 +01:00
2008-02-21 18:56:21 +01:00
2009-03-26 21:55:10 +01:00
2018-08-14 14:29:30 +02:00
2018-02-12 14:59:44 +01:00
2008-09-01 15:22:16 -04:00
2011-02-02 04:47:28 +01:00
2018-02-12 14:59:44 +01:00
2008-04-09 19:24:01 +02:00
2017-07-23 19:56:42 +02:00
2009-01-30 06:02:10 +01:00
2012-11-12 19:01:14 +01:00
2012-11-12 19:01:14 +01:00
2009-01-30 06:01:12 +01:00
2018-02-12 14:59:44 +01:00
2009-03-05 01:43:29 +01:00
2019-09-06 10:34:36 +02:00
2019-05-07 03:24:43 +08:00
2017-04-13 11:38:00 +02:00
2009-12-31 16:24:47 +01:00
2019-11-20 22:45:18 +01:00