1. 29 5月, 2018 1 次提交
  2. 23 5月, 2018 1 次提交
  3. 07 5月, 2018 1 次提交
  4. 27 4月, 2018 3 次提交
  5. 24 4月, 2018 1 次提交
  6. 16 4月, 2018 1 次提交
    • A
      netfilter: fix CONFIG_NF_REJECT_IPV6=m link error · a6615743
      Arnd Bergmann 提交于
      We get a new link error with CONFIG_NFT_REJECT_INET=y and CONFIG_NF_REJECT_IPV6=m
      after larger parts of the nftables modules are linked together:
      
      net/netfilter/nft_reject_inet.o: In function `nft_reject_inet_eval':
      nft_reject_inet.c:(.text+0x17c): undefined reference to `nf_send_unreach6'
      nft_reject_inet.c:(.text+0x190): undefined reference to `nf_send_reset6'
      
      The problem is that with NF_TABLES_INET set, we implicitly try to use
      the ipv6 version as well for NFT_REJECT, but when CONFIG_IPV6 is set to
      a loadable module, it's impossible to reach that.
      
      The best workaround I found is to express the above as a Kconfig
      dependency, forcing NFT_REJECT itself to be 'm' in that particular
      configuration.
      
      Fixes: 02c7b25e ("netfilter: nf_tables: build-in filter chain type")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      a6615743
  7. 30 3月, 2018 1 次提交
  8. 02 2月, 2018 1 次提交
    • P
      netfilter: flowtable infrastructure depends on NETFILTER_INGRESS · 6be3bcd7
      Pablo Neira Ayuso 提交于
      config NF_FLOW_TABLE depends on NETFILTER_INGRESS. If users forget to
      enable this toggle, flowtable registration fails with EOPNOTSUPP.
      
      Moreover, turn 'select NF_FLOW_TABLE' in every flowtable family flavour
      into dependency instead, otherwise this new dependency on
      NETFILTER_INGRESS causes a warning. This also allows us to remove the
      explicit dependency between family flowtables <-> NF_TABLES and
      NF_CONNTRACK, given they depend on the NF_FLOW_TABLE core that already
      expresses the general dependencies for this new infrastructure.
      
      Moreover, NF_FLOW_TABLE_INET depends on NF_FLOW_TABLE_IPV4 and
      NF_FLOWTABLE_IPV6, which already depends on NF_FLOW_TABLE. So we can get
      rid of direct dependency with NF_FLOW_TABLE.
      
      In general, let's avoid 'select', it just makes things more complicated.
      Reported-by: NJohn Crispin <john@phrozen.org>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      6be3bcd7
  9. 16 1月, 2018 1 次提交
    • A
      netfilter: nf_tables: flow_offload depends on flow_table · 9be9d04b
      Arnd Bergmann 提交于
      Without CONFIG_NF_FLOW_TABLE, the new nft_flow_offload module produces
      a link error:
      
      net/netfilter/nft_flow_offload.o: In function `nft_flow_offload_iterate_cleanup':
      nft_flow_offload.c:(.text+0xb0): undefined reference to `nf_flow_table_iterate'
      net/netfilter/nft_flow_offload.o: In function `flow_offload_iterate_cleanup':
      nft_flow_offload.c:(.text+0x160): undefined reference to `flow_offload_dead'
      net/netfilter/nft_flow_offload.o: In function `nft_flow_offload_eval':
      nft_flow_offload.c:(.text+0xc4c): undefined reference to `flow_offload_alloc'
      nft_flow_offload.c:(.text+0xc64): undefined reference to `flow_offload_add'
      nft_flow_offload.c:(.text+0xc94): undefined reference to `flow_offload_free'
      
      This adds a Kconfig dependency for it.
      
      Fixes: a3c90f7a ("netfilter: nf_tables: flow offload expression")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      9be9d04b
  10. 11 1月, 2018 1 次提交
    • A
      netfilter: improve flow table Kconfig dependencies · a0a97f2a
      Arnd Bergmann 提交于
      The newly added NF_FLOW_TABLE options cause some build failures in
      randconfig kernels:
      
      - when CONFIG_NF_CONNTRACK is disabled, or is a loadable module but
        NF_FLOW_TABLE is built-in:
      
        In file included from net/netfilter/nf_flow_table.c:8:0:
        include/net/netfilter/nf_conntrack.h:59:22: error: field 'ct_general' has incomplete type
          struct nf_conntrack ct_general;
        include/net/netfilter/nf_conntrack.h: In function 'nf_ct_get':
        include/net/netfilter/nf_conntrack.h:148:15: error: 'const struct sk_buff' has no member named '_nfct'
        include/net/netfilter/nf_conntrack.h: In function 'nf_ct_put':
        include/net/netfilter/nf_conntrack.h:157:2: error: implicit declaration of function 'nf_conntrack_put'; did you mean 'nf_ct_put'? [-Werror=implicit-function-declaration]
      
        net/netfilter/nf_flow_table.o: In function `nf_flow_offload_work_gc':
        (.text+0x1540): undefined reference to `nf_ct_delete'
      
      - when CONFIG_NF_TABLES is disabled:
      
        In file included from net/ipv6/netfilter/nf_flow_table_ipv6.c:13:0:
        include/net/netfilter/nf_tables.h: In function 'nft_gencursor_next':
        include/net/netfilter/nf_tables.h:1189:14: error: 'const struct net' has no member named 'nft'; did you mean 'nf'?
      
       - when CONFIG_NF_FLOW_TABLE_INET is enabled, but NF_FLOW_TABLE_IPV4
        or NF_FLOW_TABLE_IPV6 are not, or are loadable modules
      
        net/netfilter/nf_flow_table_inet.o: In function `nf_flow_offload_inet_hook':
        nf_flow_table_inet.c:(.text+0x94): undefined reference to `nf_flow_offload_ipv6_hook'
        nf_flow_table_inet.c:(.text+0x40): undefined reference to `nf_flow_offload_ip_hook'
      
      - when CONFIG_NF_FLOW_TABLES is disabled, but the other options are
        enabled:
      
        net/netfilter/nf_flow_table_inet.o: In function `nf_flow_offload_inet_hook':
        nf_flow_table_inet.c:(.text+0x6c): undefined reference to `nf_flow_offload_ipv6_hook'
        net/netfilter/nf_flow_table_inet.o: In function `nf_flow_inet_module_exit':
        nf_flow_table_inet.c:(.exit.text+0x8): undefined reference to `nft_unregister_flowtable_type'
        net/netfilter/nf_flow_table_inet.o: In function `nf_flow_inet_module_init':
        nf_flow_table_inet.c:(.init.text+0x8): undefined reference to `nft_register_flowtable_type'
        net/ipv4/netfilter/nf_flow_table_ipv4.o: In function `nf_flow_ipv4_module_exit':
        nf_flow_table_ipv4.c:(.exit.text+0x8): undefined reference to `nft_unregister_flowtable_type'
        net/ipv4/netfilter/nf_flow_table_ipv4.o: In function `nf_flow_ipv4_module_init':
        nf_flow_table_ipv4.c:(.init.text+0x8): undefined reference to `nft_register_flowtable_type'
      
      This adds additional Kconfig dependencies to ensure that NF_CONNTRACK and NF_TABLES
      are always visible from NF_FLOW_TABLE, and that the internal dependencies between
      the four new modules are met.
      
      Fixes: 7c23b629 ("netfilter: flow table support for the mixed IPv4/IPv6 family")
      Fixes: 09952107 ("netfilter: flow table support for IPv6")
      Fixes: 97add9f0 ("netfilter: flow table support for IPv4")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      a0a97f2a
  11. 09 1月, 2018 5 次提交
  12. 01 8月, 2017 1 次提交
  13. 08 2月, 2017 2 次提交
  14. 16 1月, 2017 1 次提交
  15. 05 1月, 2017 1 次提交
  16. 07 12月, 2016 1 次提交
  17. 05 12月, 2016 6 次提交
  18. 02 11月, 2016 4 次提交
    • A
      netfilter: nf_tables: introduce routing expression · 2fa84193
      Anders K. Pedersen 提交于
      Introduces an nftables rt expression for routing related data with support
      for nexthop (i.e. the directly connected IP address that an outgoing packet
      is sent to), which can be used either for matching or accounting, eg.
      
       # nft add rule filter postrouting \
      	ip daddr 192.168.1.0/24 rt nexthop != 192.168.0.1 drop
      
      This will drop any traffic to 192.168.1.0/24 that is not routed via
      192.168.0.1.
      
       # nft add rule filter postrouting \
      	flow table acct { rt nexthop timeout 600s counter }
       # nft add rule ip6 filter postrouting \
      	flow table acct { rt nexthop timeout 600s counter }
      
      These rules count outgoing traffic per nexthop. Note that the timeout
      releases an entry if no traffic is seen for this nexthop within 10 minutes.
      
       # nft add rule inet filter postrouting \
      	ether type ip \
      	flow table acct { rt nexthop timeout 600s counter }
       # nft add rule inet filter postrouting \
      	ether type ip6 \
      	flow table acct { rt nexthop timeout 600s counter }
      
      Same as above, but via the inet family, where the ether type must be
      specified explicitly.
      
      "rt classid" is also implemented identical to "meta rtclassid", since it
      is more logical to have this match in the routing expression going forward.
      Signed-off-by: NAnders K. Pedersen <akp@cohaesio.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2fa84193
    • P
      netfilter: move socket lookup infrastructure to nf_socket_ipv{4,6}.c · 8db4c5be
      Pablo Neira Ayuso 提交于
      We need this split to reuse existing codebase for the upcoming nf_tables
      socket expression.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      8db4c5be
    • P
      netfilter: nf_log: add packet logging for netdev family · 1fddf4ba
      Pablo Neira Ayuso 提交于
      Move layer 2 packet logging into nf_log_l2packet() that resides in
      nf_log_common.c, so this can be shared by both bridge and netdev
      families.
      
      This patch adds the boiler plate code to register the netdev logging
      family.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      1fddf4ba
    • F
      netfilter: nf_tables: add fib expression · f6d0cbcf
      Florian Westphal 提交于
      Add FIB expression, supported for ipv4, ipv6 and inet family (the latter
      just dispatches to ipv4 or ipv6 one based on nfproto).
      
      Currently supports fetching output interface index/name and the
      rtm_type associated with an address.
      
      This can be used for adding path filtering. rtm_type is useful
      to e.g. enforce a strong-end host model where packets
      are only accepted if daddr is configured on the interface the
      packet arrived on.
      
      The fib expression is a native nftables alternative to the
      xtables addrtype and rp_filter matches.
      
      FIB result order for oif/oifname retrieval is as follows:
       - if packet is local (skb has rtable, RTF_LOCAL set, this
         will also catch looped-back multicast packets), set oif to
         the loopback interface.
       - if fib lookup returns an error, or result points to local,
         store zero result.  This means '--local' option of -m rpfilter
         is not supported. It is possible to use 'fib type local' or add
         explicit saddr/daddr matching rules to create exceptions if this
         is really needed.
       - store result in the destination register.
         In case of multiple routes, search set for desired oif in case
         strict matching is requested.
      
      ipv4 and ipv6 behave fib expressions are supposed to behave the same.
      
      [ I have collapsed Arnd Bergmann's ("netfilter: nf_tables: fib warnings")
      
      	http://patchwork.ozlabs.org/patch/688615/
      
        to address fallout from this patch after rebasing nf-next, that was
        posted to address compilation warnings. --pablo ]
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      f6d0cbcf
  19. 22 8月, 2016 2 次提交
    • L
      netfilter: nf_tables: add number generator expression · 91dbc6be
      Laura Garcia Liebana 提交于
      This patch adds the numgen expression that allows us to generated
      incremental and random numbers, this generator is bound to a upper limit
      that is specified by userspace.
      
      This expression is useful to distribute packets in a round-robin fashion
      as well as randomly.
      Signed-off-by: NLaura Garcia Liebana <nevola@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      91dbc6be
    • P
      netfilter: nf_tables: add quota expression · 3d2f30a1
      Pablo Neira Ayuso 提交于
      This patch adds the quota expression. This new stateful expression
      integrate easily into the dynset expression to build 'hashquota' flow
      tables.
      
      Arguably, we could use instead "counter bytes > 1000" instead, but this
      approach has several problems:
      
      1) We only support for one single stateful expression in dynamic set
         definitions, and the expression above is a composite of two
         expressions: get counter + comparison.
      
      2) We would need to restore the packed counter representation (that we
         used to have) based on seqlock to synchronize this, since per-cpu is
         not suitable for this.
      
      So instead of bloating the counter expression back with the seqlock
      representation and extending the existing set infrastructure to make it
      more complex for the composite described above, let's follow the more
      simple approach of adding a quota expression that we can plug into our
      existing infrastructure.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      3d2f30a1
  20. 12 8月, 2016 2 次提交
  21. 01 7月, 2016 1 次提交
  22. 08 2月, 2016 1 次提交
    • A
      netfilter: tee: select NF_DUP_IPV6 unconditionally · 08a7f5d3
      Arnd Bergmann 提交于
      The NETFILTER_XT_TARGET_TEE option selects NF_DUP_IPV6 whenever
      IP6_NF_IPTABLES is enabled, and it ensures that it cannot be
      builtin itself if NF_CONNTRACK is a loadable module, as that
      is a dependency for NF_DUP_IPV6.
      
      However, NF_DUP_IPV6 can be enabled even if IP6_NF_IPTABLES is
      turned off, and it only really depends on IPV6. With the current
      check in tee_tg6, we call nf_dup_ipv6() whenever NF_DUP_IPV6
      is enabled. This can however be a loadable module which is
      unreachable from a built-in xt_TEE:
      
      net/built-in.o: In function `tee_tg6':
      :(.text+0x67728): undefined reference to `nf_dup_ipv6'
      
      The bug was originally introduced in the split of the xt_TEE module
      into separate modules for ipv4 and ipv6, and two patches tried
      to fix it unsuccessfully afterwards.
      
      This is a revert of the the first incorrect attempt to fix it,
      going back to depending on IPV6 as the dependency, and we
      adapt the 'select' condition accordingly.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: bbde9fc1 ("netfilter: factor out packet duplication for IPv4/IPv6")
      Fixes: 116984a3 ("netfilter: xt_TEE: use IS_ENABLED(CONFIG_NF_DUP_IPV6)")
      Fixes: 74ec4d55 ("netfilter: fix xt_TEE and xt_TPROXY dependencies")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      08a7f5d3
  23. 05 1月, 2016 1 次提交