Skip to contentSkip to conversation

masquerade_check: size 24 != 20

DISCUSSION Duncan Sands 1 participant 1 message Oct 3, 2003

lore
Share & tools
lore
#0 lore raw

With 2.4.23-pre and 2.5/6 kernels my firewall setup fails at this line:

iptables -t nat -A atm0_masq -s 192.168.58.0/24 -d 0.0.0.0/0 -j MASQUERADE

(the kernel returns -EINVAL). On the other hand it works with 2.4.20+gentoo patches with the same .config.

The command gets as far as the checkentry call into ipt_MASQUERADE.c (i.e. masquerade_check), at which point it bails out because the size of the ip_nat_multi_range type (20) differs from the target_size (24) passed to it:

translate_table: size 1112
Finished chain 0
Finished chain 3
Finished chain 4
find_inlist: loading `ipt_MASQUERADE'.
masquerade_check: size 24 != 20.
ip_tables: check failed for `MASQUERADE'.

The check in question is:

        if (targinfosize != IPT_ALIGN(sizeof(*mr))) {
                DEBUGP("masquerade_check: size %u != %u.\n",
                       targinfosize, sizeof(*mr));
                return 0;
        }

All this suggests to me that the size of some kernel structure has changed. Now Tom Eastep tried with the same kernel and didn't get this, which is kind of informative: it suggests a different compiler version padding things differently (my gcc version is 3.2.3), or some config setting I have quietly changing the size of some object. Before rummaging around further, I thought I'd ask here if anyone has any ideas.

Thanks for any help,

Duncan.