1. 13 9月, 2019 1 次提交
    • J
      netfilter: fix coding-style errors. · b0edba2a
      Jeremy Sowden 提交于
      Several header-files, Kconfig files and Makefiles have trailing
      white-space.  Remove it.
      
      In netfilter/Kconfig, indent the type of CONFIG_NETFILTER_NETLINK_ACCT
      correctly.
      
      There are semicolons at the end of two function definitions in
      include/net/netfilter/nf_conntrack_acct.h and
      include/net/netfilter/nf_conntrack_ecache.h. Remove them.
      
      Fix indentation in nf_conntrack_l4proto.h.
      Signed-off-by: NJeremy Sowden <jeremy@azazel.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      b0edba2a
  2. 16 7月, 2019 1 次提交
  3. 06 7月, 2019 1 次提交
  4. 29 6月, 2019 1 次提交
  5. 15 6月, 2019 1 次提交
    • M
      docs: kbuild: convert docs to ReST and rename to *.rst · cd238eff
      Mauro Carvalho Chehab 提交于
      The kbuild documentation clearly shows that the documents
      there are written at different times: some use markdown,
      some use their own peculiar logic to split sections.
      
      Convert everything to ReST without affecting too much
      the author's style and avoiding adding uneeded markups.
      
      The conversion is actually:
        - add blank lines and identation in order to identify paragraphs;
        - fix tables markups;
        - add some lists markups;
        - mark literal blocks;
        - adjust title markups.
      
      At its new index.rst, let's add a :orphan: while this is not linked to
      the main index.rst file, in order to avoid build warnings.
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      cd238eff
  6. 21 5月, 2019 1 次提交
  7. 12 4月, 2019 1 次提交
  8. 09 4月, 2019 1 次提交
  9. 18 3月, 2019 1 次提交
  10. 01 3月, 2019 3 次提交
  11. 27 2月, 2019 2 次提交
    • F
      netfilter: nat: merge nf_nat_ipv4,6 into nat core · 3bf195ae
      Florian Westphal 提交于
      before:
         text    data     bss     dec     hex filename
        16566    1576    4136   22278    5706 nf_nat.ko
         3598	    844	      0	   4442	   115a	nf_nat_ipv6.ko
         3187	    844	      0	   4031	    fbf	nf_nat_ipv4.ko
      
      after:
         text    data     bss     dec     hex filename
        22948    1612    4136   28696    7018 nf_nat.ko
      
      ... with ipv4/v6 nat now provided directly via nf_nat.ko.
      
      Also changes:
             ret = nf_nat_ipv4_fn(priv, skb, state);
             if (ret != NF_DROP && ret != NF_STOLEN &&
      into
      	if (ret != NF_ACCEPT)
      		return ret;
      
      everywhere.
      
      The nat hooks never should return anything other than
      ACCEPT or DROP (and the latter only in rare error cases).
      
      The original code uses multi-line ANDing including assignment-in-if:
              if (ret != NF_DROP && ret != NF_STOLEN &&
                 !(IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED) &&
                  (ct = nf_ct_get(skb, &ctinfo)) != NULL) {
      
      I removed this while moving, breaking those in separate conditionals
      and moving the assignments into extra lines.
      
      checkpatch still generates some warnings:
       1. Overly long lines (of moved code).
          Breaking them is even more ugly. so I kept this as-is.
       2. use of extern function declarations in a .c file.
          This is necessary evil, we must call
          nf_nat_l3proto_register() from the nat core now.
          All l3proto related functions are removed later in this series,
          those prototypes are then removed as well.
      
      v2: keep empty nf_nat_ipv6_csum_update stub for CONFIG_IPV6=n case.
      v3: remove IS_ENABLED(NF_NAT_IPV4/6) tests, NF_NAT_IPVx toggles
          are removed here.
      v4: also get rid of the assignments in conditionals.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      3bf195ae
    • F
      netfilter: nat: merge ipv4 and ipv6 masquerade functionality · d1aca8ab
      Florian Westphal 提交于
      Before:
         text	   data	    bss	    dec	    hex	filename
        13916	   1412	   4128	  19456	   4c00	nf_nat.ko
         4510	    968	      4	   5482	   156a	nf_nat_ipv4.ko
         5146	    944	      8	   6098	   17d2	nf_nat_ipv6.ko
      
      After:
         text	   data	    bss	    dec	    hex	filename
        16566	   1576	   4136	  22278	   5706	nf_nat.ko
         3187	    844	      0	   4031	    fbf	nf_nat_ipv4.ko
         3598	    844	      0	   4442	   115a	nf_nat_ipv6.ko
      
      ... so no drastic changes in combined size.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      d1aca8ab
  12. 18 1月, 2019 1 次提交
    • F
      netfilter: conntrack: gre: switch module to be built-in · 22fc4c4c
      Florian Westphal 提交于
      This makes the last of the modular l4 trackers 'bool'.
      
      After this, all infrastructure to handle dynamic l4 protocol registration
      becomes obsolete and can be removed in followup patches.
      
      Old:
      302824 net/netfilter/nf_conntrack.ko
       21504 net/netfilter/nf_conntrack_proto_gre.ko
      
      New:
      313728 net/netfilter/nf_conntrack.ko
      
      Old:
         text	   data	    bss	    dec	    hex	filename
         6281	   1732	      4	   8017	   1f51	nf_conntrack_proto_gre.ko
       108356	  20613	    236	 129205	  1f8b5	nf_conntrack.ko
      New:
       112095	  21381	    240	 133716	  20a54	nf_conntrack.ko
      
      The size increase is only temporary.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      22fc4c4c
  13. 18 12月, 2018 1 次提交
    • F
      netfilter: nat: remove l4proto->manip_pkt · faec18db
      Florian Westphal 提交于
      This removes the last l4proto indirection, the two callers, the l3proto
      packet mangling helpers for ipv4 and ipv6, now call the
      nf_nat_l4proto_manip_pkt() helper.
      
      nf_nat_proto_{dccp,tcp,sctp,gre,icmp,icmpv6} are left behind, even though
      they contain no functionality anymore to not clutter this patch.
      
      Next patch will remove the empty files and the nf_nat_l4proto
      struct.
      
      nf_nat_proto_udp.c is renamed to nf_nat_proto.c, as it now contains the
      other nat manip functionality as well, not just udp and udplite.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      faec18db
  14. 17 9月, 2018 1 次提交
  15. 24 8月, 2018 1 次提交
  16. 04 8月, 2018 3 次提交
  17. 30 7月, 2018 3 次提交
  18. 17 7月, 2018 2 次提交
    • M
      netfilter: Kconfig: Change select IPv6 dependencies · 5d400a49
      Máté Eckl 提交于
      ... from IPV6 to NF_TABLES_IPV6 and IP6_NF_IPTABLES.
      
      In some cases module selects depend on IPV6, but this means that they
      select another module even if eg. NF_TABLES_IPV6 is not set in which
      case the selected module is useless due to the lack of IPv6 nf_tables
      functionality.
      
      The same applies for IP6_NF_IPTABLES and iptables.
      
      Joint work with: Arnd Bermann <arnd@arndb.de>
      Signed-off-by: NMáté Eckl <ecklm94@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      5d400a49
    • F
      netfilter: conntrack: remove l3proto abstraction · a0ae2562
      Florian Westphal 提交于
      This unifies ipv4 and ipv6 protocol trackers and removes the l3proto
      abstraction.
      
      This gets rid of all l3proto indirect calls and the need to do
      a lookup on the function to call for l3 demux.
      
      It increases module size by only a small amount (12kbyte), so this reduces
      size because nf_conntrack.ko is useless without either nf_conntrack_ipv4
      or nf_conntrack_ipv6 module.
      
      before:
         text    data     bss     dec     hex filename
         7357    1088       0    8445    20fd nf_conntrack_ipv4.ko
         7405    1084       4    8493    212d nf_conntrack_ipv6.ko
        72614   13689     236   86539   1520b nf_conntrack.ko
       19K nf_conntrack_ipv4.ko
       19K nf_conntrack_ipv6.ko
      179K nf_conntrack.ko
      
      after:
         text    data     bss     dec     hex filename
        79277   13937     236   93450   16d0a nf_conntrack.ko
        191K nf_conntrack.ko
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      a0ae2562
  19. 16 7月, 2018 1 次提交
  20. 07 7月, 2018 1 次提交
  21. 03 6月, 2018 2 次提交
    • P
      netfilter: nf_tables: add connlimit support · 290180e2
      Pablo Neira Ayuso 提交于
      This features which allows you to limit the maximum number of
      connections per arbitrary key. The connlimit expression is stateful,
      therefore it can be used from meters to dynamically populate a set, this
      provides a mapping to the iptables' connlimit match. This patch also
      comes that allows you define static connlimit policies.
      
      This extension depends on the nf_conncount infrastructure.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      290180e2
    • M
      netfilter: Libify xt_TPROXY · 45ca4e0c
      Máté Eckl 提交于
      The extracted functions will likely be usefull to implement tproxy
      support in nf_tables.
      
      Extrancted functions:
      	- nf_tproxy_sk_is_transparent
      	- nf_tproxy_laddr4
      	- nf_tproxy_handle_time_wait4
      	- nf_tproxy_get_sock_v4
      	- nf_tproxy_laddr6
      	- nf_tproxy_handle_time_wait6
      	- nf_tproxy_get_sock_v6
      
      (nf_)tproxy_handle_time_wait6 also needed some refactor as its current
      implementation was xtables-specific.
      Signed-off-by: NMáté Eckl <ecklm94@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      45ca4e0c
  22. 01 6月, 2018 1 次提交
  23. 29 5月, 2018 1 次提交
  24. 23 5月, 2018 1 次提交
  25. 07 5月, 2018 1 次提交
  26. 27 4月, 2018 3 次提交
  27. 24 4月, 2018 1 次提交
  28. 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
  29. 30 3月, 2018 1 次提交