• Liping Zhang's avatar
    netfilter: nft_ct: unnecessary to require dir when use ct l3proto/protocol · d767ff2c
    Liping Zhang authored
    Currently, if the user want to match ct l3proto, we must specify the
    direction, for example:
      # nft add rule filter input ct original l3proto ipv4
                                     ^^^^^^^^
    Otherwise, error message will be reported:
      # nft add rule filter input ct l3proto ipv4
      nft add rule filter input ct l3proto ipv4
      <cmdline>:1:1-38: Error: Could not process rule: Invalid argument
      add rule filter input ct l3proto ipv4
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    Actually, there's no need to require NFTA_CT_DIRECTION attr, because
    ct l3proto and protocol are unrelated to direction.
    
    And for compatibility, even if the user specify the NFTA_CT_DIRECTION
    attr, do not report error, just skip it.
    Signed-off-by: default avatarLiping Zhang <liping.zhang@spreadtrum.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    d767ff2c
nft_ct.c 11.9 KB