• Florian Westphal's avatar
    netlink: introduce NLA_POLICY_MAX_BE · 08724ef6
    Florian Westphal authored
    netlink allows to specify allowed ranges for integer types.
    Unfortunately, nfnetlink passes integers in big endian, so the existing
    NLA_POLICY_MAX() cannot be used.
    
    At the moment, nfnetlink users, such as nf_tables, need to resort to
    programmatic checking via helpers such as nft_parse_u32_check().
    
    This is both cumbersome and error prone.  This adds NLA_POLICY_MAX_BE
    which adds range check support for BE16, BE32 and BE64 integers.
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    08724ef6
nlattr.c 27.3 KB