1. 31 3月, 2021 2 次提交
  2. 28 1月, 2021 1 次提交
  3. 31 10月, 2020 1 次提交
  4. 16 10月, 2020 1 次提交
  5. 30 7月, 2020 1 次提交
  6. 14 6月, 2020 1 次提交
    • M
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada 提交于
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  7. 01 5月, 2020 1 次提交
  8. 19 3月, 2020 1 次提交
  9. 18 3月, 2020 1 次提交
    • L
      netfilter: Introduce egress hook · 8537f786
      Lukas Wunner 提交于
      Commit e687ad60 ("netfilter: add netfilter ingress hook after
      handle_ing() under unique static key") introduced the ability to
      classify packets on ingress.
      
      Allow the same on egress.  Position the hook immediately before a packet
      is handed to tc and then sent out on an interface, thereby mirroring the
      ingress order.  This order allows marking packets in the netfilter
      egress hook and subsequently using the mark in tc.  Another benefit of
      this order is consistency with a lot of existing documentation which
      says that egress tc is performed after netfilter hooks.
      
      Egress hooks already exist for the most common protocols, such as
      NF_INET_LOCAL_OUT or NF_ARP_OUT, and those are to be preferred because
      they are executed earlier during packet processing.  However for more
      exotic protocols, there is currently no provision to apply netfilter on
      egress.  A common workaround is to enslave the interface to a bridge and
      use ebtables, or to resort to tc.  But when the ingress hook was
      introduced, consensus was that users should be given the choice to use
      netfilter or tc, whichever tool suits their needs best:
      https://lore.kernel.org/netdev/20150430153317.GA3230@salvia/
      This hook is also useful for NAT46/NAT64, tunneling and filtering of
      locally generated af_packet traffic such as dhclient.
      
      There have also been occasional user requests for a netfilter egress
      hook in the past, e.g.:
      https://www.spinics.net/lists/netfilter/msg50038.html
      
      Performance measurements with pktgen surprisingly show a speedup rather
      than a slowdown with this commit:
      
      * Without this commit:
        Result: OK: 34240933(c34238375+d2558) usec, 100000000 (60byte,0frags)
        2920481pps 1401Mb/sec (1401830880bps) errors: 0
      
      * With this commit:
        Result: OK: 33997299(c33994193+d3106) usec, 100000000 (60byte,0frags)
        2941410pps 1411Mb/sec (1411876800bps) errors: 0
      
      * Without this commit + tc egress:
        Result: OK: 39022386(c39019547+d2839) usec, 100000000 (60byte,0frags)
        2562631pps 1230Mb/sec (1230062880bps) errors: 0
      
      * With this commit + tc egress:
        Result: OK: 37604447(c37601877+d2570) usec, 100000000 (60byte,0frags)
        2659259pps 1276Mb/sec (1276444320bps) errors: 0
      
      * With this commit + nft egress:
        Result: OK: 41436689(c41434088+d2600) usec, 100000000 (60byte,0frags)
        2413320pps 1158Mb/sec (1158393600bps) errors: 0
      
      Tested on a bare-metal Core i7-3615QM, each measurement was performed
      three times to verify that the numbers are stable.
      
      Commands to perform a measurement:
      modprobe pktgen
      echo "add_device lo@3" > /proc/net/pktgen/kpktgend_3
      samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh -i 'lo@3' -n 100000000
      
      Commands for testing tc egress:
      tc qdisc add dev lo clsact
      tc filter add dev lo egress protocol ip prio 1 u32 match ip dst 4.3.2.1/32
      
      Commands for testing nft egress:
      nft add table netdev t
      nft add chain netdev t co \{ type filter hook egress device lo priority 0 \; \}
      nft add rule netdev t co ip daddr 4.3.2.1/32 drop
      
      All testing was performed on the loopback interface to avoid distorting
      measurements by the packet handling in the low-level Ethernet driver.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      8537f786
  10. 15 3月, 2020 1 次提交
    • F
      netfilter: nf_tables: make sets built-in · e32a4dc6
      Florian Westphal 提交于
      Placing nftables set support in an extra module is pointless:
      
      1. nf_tables needs dynamic registeration interface for sake of one module
      2. nft heavily relies on sets, e.g. even simple rule like
         "nft ... tcp dport { 80, 443 }" will not work with _SETS=n.
      
      IOW, either nftables isn't used or both nf_tables and nf_tables_set
      modules are needed anyway.
      
      With extra module:
       307K net/netfilter/nf_tables.ko
        79K net/netfilter/nf_tables_set.ko
      
         text  data  bss     dec filename
       146416  3072  545  150033 nf_tables.ko
        35496  1817    0   37313 nf_tables_set.ko
      
      This patch:
       373K net/netfilter/nf_tables.ko
      
       178563  4049  545  183157 nf_tables.ko
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      e32a4dc6
  11. 26 9月, 2019 1 次提交
  12. 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
  13. 16 7月, 2019 1 次提交
  14. 06 7月, 2019 1 次提交
  15. 29 6月, 2019 1 次提交
  16. 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
  17. 21 5月, 2019 1 次提交
  18. 12 4月, 2019 1 次提交
  19. 09 4月, 2019 1 次提交
  20. 18 3月, 2019 1 次提交
  21. 01 3月, 2019 3 次提交
  22. 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
  23. 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
  24. 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
  25. 17 9月, 2018 1 次提交
  26. 24 8月, 2018 1 次提交
  27. 04 8月, 2018 3 次提交
  28. 30 7月, 2018 3 次提交
  29. 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
  30. 16 7月, 2018 1 次提交
  31. 07 7月, 2018 1 次提交