Skip to content
  • Pablo Neira Ayuso's avatar
    a5d45bc0
    netfilter: nftables_offload: build mask based from the matching bytes · a5d45bc0
    Pablo Neira Ayuso authored
    
    
    Userspace might match on prefix bytes of header fields if they are on
    the byte boundary, this requires that the mask is adjusted accordingly.
    Use NFT_OFFLOAD_MATCH_EXACT() for meta since prefix byte matching is not
    allowed for this type of selector.
    
    The bitwise expression might be optimized out by userspace, hence the
    kernel needs to infer the prefix from the number of payload bytes to
    match on. This patch adds nft_payload_offload_mask() to calculate the
    bitmask to match on the prefix.
    
    Fixes: c9626a2c ("netfilter: nf_tables: add hardware offload support")
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    a5d45bc0
    netfilter: nftables_offload: build mask based from the matching bytes
    Pablo Neira Ayuso authored
    
    
    Userspace might match on prefix bytes of header fields if they are on
    the byte boundary, this requires that the mask is adjusted accordingly.
    Use NFT_OFFLOAD_MATCH_EXACT() for meta since prefix byte matching is not
    allowed for this type of selector.
    
    The bitwise expression might be optimized out by userspace, hence the
    kernel needs to infer the prefix from the number of payload bytes to
    match on. This patch adds nft_payload_offload_mask() to calculate the
    bitmask to match on the prefix.
    
    Fixes: c9626a2c ("netfilter: nf_tables: add hardware offload support")
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Loading