]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink_linearize: use NFT_REG32 values internally
authorPatrick McHardy <kaber@trash.net>
Sun, 12 Apr 2015 20:10:41 +0000 (21:10 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 2 Jun 2015 11:03:58 +0000 (13:03 +0200)
commit9c286f2d689bbc19889d2f3b69923ad68831b3e7
treef75756901e6f53ca160c82f3af2efe91df554974
parent59221eacafbae721c0e46b75c688f1cd0f251afc
netlink_linearize: use NFT_REG32 values internally

Prepare netlink_linearize for 32 bit register usage:

Switch to use 16 data registers of 32 bit each. A helper function takes
care of mapping the registers to the NFT_REG32 values and, if the
register refers to the beginning of an 128 bit area, the old NFT_REG_1-4
values for compatibility.

New register reservation and release helper function take the size into
account and reserve the required amount of registers.

The reservation and release functions will so far still always allocate
128 bit. If no other expression in a rule uses a 32 bit register directly,
these will be mapped to the old register values, meaning everything
continues to work with old kernel versions.

Signed-off-by: Patrick McHardy <kaber@trash.net>
include/netlink.h
src/netlink_linearize.c