Files
linux/include/net
Florian Westphal 20910cf880 netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6
commit 2a7851bffb upstream.

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: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
2013-07-16 10:35:48 -07:00
..
2012-11-19 23:56:59 +01:00
2012-08-09 16:18:06 -07:00
2012-04-15 12:44:40 -04:00
2012-04-15 12:44:40 -04:00
2010-06-03 03:21:52 -07:00
2012-04-15 12:44:40 -04:00
2012-07-19 10:43:03 -07:00
2012-10-08 17:42:36 -04:00
2011-03-31 11:26:23 -03:00
2012-12-11 12:49:53 -05:00
2013-02-28 05:38:41 -08:00
2012-08-14 14:28:32 -07:00
2008-06-11 21:00:38 -07:00
2013-02-28 05:38:41 -08:00
2011-03-31 11:26:23 -03:00
2012-05-17 18:45:20 -04:00
2008-02-29 11:46:17 -08:00
2010-06-03 03:21:52 -07:00
2012-08-07 16:24:55 -07:00
2009-01-06 11:38:15 -07:00
2011-05-17 14:16:58 -04:00
2009-03-21 19:06:50 -07:00
2012-05-19 01:08:16 -04:00
2012-11-03 14:59:04 -04:00
2013-05-01 09:46:20 -07:00
2012-08-06 13:40:47 -07:00
2013-05-24 10:23:19 -07:00
2008-07-05 21:25:39 -07:00
2009-10-07 16:39:43 -04:00
2012-04-15 12:44:40 -04:00
2012-05-16 15:17:08 -04:00
2012-04-15 12:44:40 -04:00