1. 12 6月, 2015 2 次提交
    • B
      netfilter: bridge: forward IPv6 fragmented packets · efb6de9b
      Bernhard Thaler 提交于
      IPv6 fragmented packets are not forwarded on an ethernet bridge
      with netfilter ip6_tables loaded. e.g. steps to reproduce
      
      1) create a simple bridge like this
      
              modprobe br_netfilter
              brctl addbr br0
              brctl addif br0 eth0
              brctl addif br0 eth2
              ifconfig eth0 up
              ifconfig eth2 up
              ifconfig br0 up
      
      2) place a host with an IPv6 address on each side of the bridge
      
              set IPv6 address on host A:
              ip -6 addr add fd01:2345:6789:1::1/64 dev eth0
      
              set IPv6 address on host B:
              ip -6 addr add fd01:2345:6789:1::2/64 dev eth0
      
      3) run a simple ping command on host A with packets > MTU
      
              ping6 -s 4000 fd01:2345:6789:1::2
      
      4) wait some time and run e.g. "ip6tables -t nat -nvL" on the bridge
      
      IPv6 fragmented packets traverse the bridge cleanly until somebody runs.
      "ip6tables -t nat -nvL". As soon as it is run (and netfilter modules are
      loaded) IPv6 fragmented packets do not traverse the bridge any more (you
      see no more responses in ping's output).
      
      After applying this patch IPv6 fragmented packets traverse the bridge
      cleanly in above scenario.
      Signed-off-by: NBernhard Thaler <bernhard.thaler@wvnet.at>
      [pablo@netfilter.org: small changes to br_nf_dev_queue_xmit]
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      efb6de9b
    • B
      netfilter: bridge: detect NAT66 correctly and change MAC address · 72b31f72
      Bernhard Thaler 提交于
      IPv4 iptables allows to REDIRECT/DNAT/SNAT any traffic over a bridge.
      
      e.g. REDIRECT
      $ sysctl -w net.bridge.bridge-nf-call-iptables=1
      $ iptables -t nat -A PREROUTING -p tcp -m tcp --dport 8080 \
        -j REDIRECT --to-ports 81
      
      This does not work with ip6tables on a bridge in NAT66 scenario
      because the REDIRECT/DNAT/SNAT is not correctly detected.
      
      The bridge pre-routing (finish) netfilter hook has to check for a possible
      redirect and then fix the destination mac address. This allows to use the
      ip6tables rules for local REDIRECT/DNAT/SNAT REDIRECT similar to the IPv4
      iptables version.
      
      e.g. REDIRECT
      $ sysctl -w net.bridge.bridge-nf-call-ip6tables=1
      $ ip6tables -t nat -A PREROUTING -p tcp -m tcp --dport 8080 \
        -j REDIRECT --to-ports 81
      
      This patch makes it possible to use IPv6 NAT66 on a bridge. It was tested
      on a bridge with two interfaces using SNAT/DNAT NAT66 rules.
      Reported-by: NArtie Hamilton <artiemhamilton@yahoo.com>
      Signed-off-by: NSven Eckelmann <sven@open-mesh.com>
      [bernhard.thaler@wvnet.at: rebased, add indirect call to ip6_route_input()]
      [bernhard.thaler@wvnet.at: rebased, split into separate patches]
      Signed-off-by: NBernhard Thaler <bernhard.thaler@wvnet.at>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      72b31f72
  2. 05 4月, 2015 1 次提交
  3. 12 11月, 2014 1 次提交
    • J
      net: Convert LIMIT_NETDEBUG to net_dbg_ratelimited · ba7a46f1
      Joe Perches 提交于
      Use the more common dynamic_debug capable net_dbg_ratelimited
      and remove the LIMIT_NETDEBUG macro.
      
      All messages are still ratelimited.
      
      Some KERN_<LEVEL> uses are changed to KERN_DEBUG.
      
      This may have some negative impact on messages that were
      emitted at KERN_INFO that are not not enabled at all unless
      DEBUG is defined or dynamic_debug is enabled.  Even so,
      these messages are now _not_ emitted by default.
      
      This also eliminates the use of the net_msg_warn sysctl
      "/proc/sys/net/core/warnings".  For backward compatibility,
      the sysctl is not removed, but it has no function.  The extern
      declaration of net_msg_warn is removed from sock.h and made
      static in net/core/sysctl_net_core.c
      
      Miscellanea:
      
      o Update the sysctl documentation
      o Remove the embedded uses of pr_fmt
      o Coalesce format fragments
      o Realign arguments
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba7a46f1
  4. 09 5月, 2014 1 次提交
  5. 23 5月, 2013 1 次提交
    • F
      netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6 · 2a7851bf
      Florian Westphal 提交于
      Quoting https://bugzilla.netfilter.org/show_bug.cgi?id=812:
      
      [ ip6tables -m addrtype ]
      When I tried to use in the nat/PREROUTING it messes up the
      routing cache even if the rule didn't matched at all.
      [..]
      If I remove the --limit-iface-in from the non-working scenario, so just
      use the -m addrtype --dst-type LOCAL it works!
      
      This happens when LOCAL type matching is requested with --limit-iface-in,
      and the default ipv6 route is via the interface the packet we test
      arrived on.
      
      Because xt_addrtype uses ip6_route_output, the ipv6 routing implementation
      creates an unwanted cached entry, and the packet won't make it to the
      real/expected destination.
      
      Silently ignoring --limit-iface-in makes the routing work but it breaks
      rule matching (--dst-type LOCAL with limit-iface-in is supposed to only
      match if the dst address is configured on the incoming interface;
      without --limit-iface-in it will match if the address is reachable
      via lo).
      
      The test should call ipv6_chk_addr() instead.  However, this would add
      a link-time dependency on ipv6.
      
      There are two possible solutions:
      
      1) Revert the commit that moved ipt_addrtype to xt_addrtype,
         and put ipv6 specific code into ip6t_addrtype.
      2) add new "nf_ipv6_ops" struct to register pointers to ipv6 functions.
      
      While the former might seem preferable, Pablo pointed out that there
      are more xt modules with link-time dependeny issues regarding ipv6,
      so lets go for 2).
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2a7851bf
  6. 19 4月, 2013 1 次提交
    • P
      netfilter: add my copyright statements · f229f6ce
      Patrick McHardy 提交于
      Add copyright statements to all netfilter files which have had significant
      changes done by myself in the past.
      
      Some notes:
      
      - nf_conntrack_ecache.c was incorrectly attributed to Rusty and Netfilter
        Core Team when it got split out of nf_conntrack_core.c. The copyrights
        even state a date which lies six years before it was written. It was
        written in 2005 by Harald and myself.
      
      - net/ipv{4,6}/netfilter.c, net/netfitler/nf_queue.c were missing copyright
        statements. I've added the copyright statement from net/netfilter/core.c,
        where this code originated
      
      - for nf_conntrack_proto_tcp.c I've also added Jozsef, since I didn't want
        it to give the wrong impression
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      f229f6ce
  7. 08 4月, 2013 1 次提交
    • P
      netfilter: ipv6: propagate routing errors from ip6_route_me_harder() · 58e35d14
      Patrick McHardy 提交于
      Propagate routing errors from ip_route_me_harder() when dropping a packet
      using NF_DROP_ERR(). This makes userspace get the proper error instead of
      EPERM for everything.
      
      # ip -6 r a unreachable default table 100
      # ip -6 ru add fwmark 0x1 lookup 100
      # ip6tables -t mangle -A OUTPUT -d 2001:4860:4860::8888 -j MARK --set-mark 0x1
      
      Old behaviour:
      
      PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
      ping: sendmsg: Operation not permitted
      ping: sendmsg: Operation not permitted
      ping: sendmsg: Operation not permitted
      
      New behaviour:
      
      PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
      ping: sendmsg: Network is unreachable
      ping: sendmsg: Network is unreachable
      ping: sendmsg: Network is unreachable
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      58e35d14
  8. 30 8月, 2012 1 次提交
  9. 01 11月, 2011 2 次提交
  10. 23 4月, 2011 1 次提交
  11. 04 4月, 2011 2 次提交
  12. 13 3月, 2011 2 次提交
  13. 03 3月, 2011 1 次提交
  14. 18 11月, 2010 1 次提交
  15. 14 6月, 2010 1 次提交
  16. 15 4月, 2010 1 次提交
  17. 03 6月, 2009 1 次提交
  18. 26 11月, 2008 1 次提交
  19. 25 11月, 2008 1 次提交
  20. 15 10月, 2008 1 次提交
  21. 09 10月, 2008 1 次提交
  22. 08 10月, 2008 1 次提交
  23. 14 4月, 2008 1 次提交
  24. 06 3月, 2008 1 次提交
  25. 29 1月, 2008 5 次提交
  26. 16 10月, 2007 1 次提交
  27. 26 4月, 2007 1 次提交
  28. 06 3月, 2007 1 次提交
  29. 11 2月, 2007 1 次提交
  30. 03 12月, 2006 3 次提交