1
0
Fork 0
alistair23-linux/include/linux/netfilter
Florian Westphal 8f97339d3f netfilter: add ipv4 reverse path filter match
This tries to do the same thing as fib_validate_source(), but differs
in several aspects.

The most important difference is that the reverse path filter built into
fib_validate_source uses the oif as iif when performing the reverse
lookup.  We do not do this, as the oif is not yet known by the time the
PREROUTING hook is invoked.

We can't wait until FORWARD chain because by the time FORWARD is invoked
ipv4 forward path may have already sent icmp messages is response
to to-be-discarded-via-rpfilter packets.

To avoid the such an additional lookup in PREROUTING, Patrick McHardy
suggested to attach the path information directly in the match
(i.e., just do what the standard ipv4 path does a bit earlier in PREROUTING).

This works, but it also has a few caveats. Most importantly, when using
marks in PREROUTING to re-route traffic based on the nfmark, -m rpfilter
would have to be used after the nfmark has been set; otherwise the nfmark
would have no effect (because the route is already attached).

Another problem would be interaction with -j TPROXY, as this target sets an
nfmark and uses ACCEPT instead of continue, i.e. such a version of
-m rpfilter cannot be used for the initial to-be-intercepted packets.

In case in turns out that the oif is required, we can add Patricks
suggestion with a new match option (e.g. --rpf-use-oif) to keep ruleset
compatibility.

Another difference to current builtin ipv4 rpfilter is that packets subject to ipsec
transformation are not automatically excluded. If you want this, simply
combine -m rpfilter with the policy match.

Packets arriving on loopback interfaces always match.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2011-12-04 22:43:37 +01:00
..
ipset netfilter: ipset: fix compiler warnings "'hash_ip4_data_next' declared inline after being called" 2011-07-21 12:07:10 +02:00
Kbuild netfilter: ipt_addrtype: rename to xt_addrtype 2011-03-15 20:16:20 +01:00
nf_conntrack_amanda.h
nf_conntrack_common.h netfilter: add more values to enum ip_conntrack_info 2011-06-06 01:35:10 +02:00
nf_conntrack_dccp.h
nf_conntrack_ftp.h
nf_conntrack_h323.h
nf_conntrack_h323_asn1.h
nf_conntrack_h323_types.h
nf_conntrack_irc.h
nf_conntrack_pptp.h
nf_conntrack_proto_gre.h Fix common misspellings 2011-03-31 11:26:23 -03:00
nf_conntrack_sane.h
nf_conntrack_sctp.h
nf_conntrack_sip.h netfilter: nf_conntrack_sip: Add callid parser 2010-10-04 22:45:23 +09:00
nf_conntrack_snmp.h netfilter: nf_conntrack: nf_conntrack snmp helper 2011-01-18 18:12:24 +01:00
nf_conntrack_tcp.h
nf_conntrack_tftp.h
nf_conntrack_tuple_common.h
nfnetlink.h netfilter: nfnetlink: add RCU in nfnetlink_rcv_msg() 2011-07-18 16:08:07 +02:00
nfnetlink_compat.h
nfnetlink_conntrack.h netfilter: nf_conntrack_tstamp: add flow-based timestamp extension 2011-01-19 16:00:07 +01:00
nfnetlink_log.h headers: use __aligned_xx types for userspace 2011-03-18 15:14:45 -07:00
nfnetlink_queue.h netfilter: nfnetlink_queue: batch verdict support 2011-07-19 11:46:33 +02:00
x_tables.h netfilter: get rid of atomic ops in fast path 2011-04-04 17:04:03 +02:00
xt_AUDIT.h netfilter: audit target to record accepted/dropped packets 2011-01-16 18:10:28 +01:00
xt_CHECKSUM.h netfilter: correct CHECKSUM header and export it 2010-07-16 14:08:20 +02:00
xt_CLASSIFY.h
xt_CONNMARK.h netfilter: xtables: merge xt_CONNMARK into xt_connmark 2010-03-17 15:48:36 +01:00
xt_CONNSECMARK.h
xt_CT.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_DSCP.h
xt_IDLETIMER.h header: fix broken headers for user space 2010-08-22 21:15:39 -07:00
xt_LED.h
xt_MARK.h
xt_NFLOG.h
xt_NFQUEUE.h netfilter: allow NFQUEUE bypass if no listener is available 2011-01-18 16:08:30 +01:00
xt_RATEEST.h
xt_SECMARK.h secmark: make secmark object handling generic 2010-10-21 10:12:48 +11:00
xt_TCPMSS.h
xt_TCPOPTSTRIP.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_TEE.h netfilter: xt_TEE: resolve oif using netdevice notifiers 2010-04-20 15:07:32 +02:00
xt_TPROXY.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_addrtype.h netfilter: xt_addrtype: ipv6 support 2011-03-15 20:17:44 +01:00
xt_cluster.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_comment.h netfilter: xt_comment: drop unneeded unsigned qualifier 2011-01-13 12:05:11 +01:00
xt_connbytes.h headers: use __aligned_xx types for userspace 2011-03-18 15:14:45 -07:00
xt_connlimit.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_connmark.h netfilter: xtables: merge xt_CONNMARK into xt_connmark 2010-03-17 15:48:36 +01:00
xt_conntrack.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_cpu.h netfilter: add xt_cpu match 2010-07-23 12:59:36 +02:00
xt_dccp.h
xt_devgroup.h netfilter: xtables: add device group match 2011-02-03 00:05:43 +01:00
xt_dscp.h
xt_esp.h
xt_hashlimit.h
xt_helper.h
xt_iprange.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_ipvs.h netfilter: fix userspace header warning 2010-08-18 23:34:26 -07:00
xt_length.h
xt_limit.h
xt_mac.h
xt_mark.h
xt_multiport.h
xt_osf.h
xt_owner.h
xt_physdev.h
xt_pkttype.h
xt_policy.h
xt_quota.h headers: use __aligned_xx types for userspace 2011-03-18 15:14:45 -07:00
xt_rateest.h
xt_realm.h
xt_recent.h netfilter: xt_recent: check for unsupported user space flags 2010-03-17 16:18:56 +01:00
xt_rpfilter.h netfilter: add ipv4 reverse path filter match 2011-12-04 22:43:37 +01:00
xt_sctp.h
xt_set.h netfilter: ipset: options and flags support added to the kernel API 2011-06-16 18:42:40 +02:00
xt_socket.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_state.h
xt_statistic.h
xt_string.h
xt_tcpmss.h
xt_tcpudp.h
xt_time.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00
xt_u32.h netfilter: xtables: add missing header inclusions for headers_check 2011-01-20 17:50:17 +01:00