netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/4] netfilter reverse path filter matches
@ 2011-11-09 22:19 Florian Westphal
  2011-11-09 22:19 ` [PATCH nf-next 1/4] net: ipv4: export fib_lookup and fib_table_lookup Florian Westphal
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Florian Westphal @ 2011-11-09 22:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: netdev

Version 3 of the ipv4/v6 reverse path filter matches discussed
during nfws 2011.

Major change since v2 is that the ipv4 version no longer tries
to determine the (likely) input interface for the reverse test.

To obtain that information, an additional lookup would be
required (first obtain oif, then use that oif as iif in the
reversed lookup -- this is what the existing rpf in fib_validate_source()
does).
While its certainly possible to mimic fib_validate_source more closely,
doing so has certain side effects:
- either pay additonal rt lookup cost
- or, attach the input route early on ourselves, so ipv4 stack does
  not need to do it (which can then cause strange effects when using
  policy routing, as marking in pre-routing has no effect when done
  after -m rpfilter ...)

2nd change is a new "--invert" flag to permit one-line dropping
("-m rpfilter --invert -j DROP") of packets that failed the reverse
path lookup test.

Userspace part is stored in my iptables repository on
http://git.breakpoint.cc/cgi-bin/gitweb.cgi?p=fw/iptables.git (branch 'xt_rpfilter_9').

Kernel patches are located in the 'xt_rpfilter_9' branch on
http://git.breakpoint.cc/cgi-bin/gitweb.cgi?p=fw/nf-next.git.

Patches will be sent as followup to this email.

Summary of changes:

The following changes since commit e56c57d0d3fdbbdf583d3af96bfb803b8dfa713e:

net: rename sk_clone to sk_clone_lock (2011-11-08 17:07:07 -0500)

are available in the git repository at:
git://git.breakpoint.cc/fw/nf-next.git xt_rpfilter_9

Florian Westphal (4):
  net: ipv4: export fib_lookup and fib_table_lookup
  netfilter: add ipv4 reverse path filter match
  ipv6: add ip6_route_lookup
  netfilter: add ipv6 reverse path filter match

include/linux/netfilter/xt_rpfilter.h |   23 ++++++
include/net/ip6_route.h               |    2 +
net/ipv4/fib_rules.c                  |    1 +
net/ipv4/fib_trie.c                   |    1 +
net/ipv4/netfilter/Kconfig            |   10 +++
net/ipv4/netfilter/Makefile           |    1 +
net/ipv4/netfilter/ipt_rpfilter.c     |  141 +++++++++++++++++++++++++++++++++
net/ipv6/netfilter/Kconfig            |   10 +++
net/ipv6/netfilter/Makefile           |    1 +
net/ipv6/netfilter/ip6t_rpfilter.c    |  133 +++++++++++++++++++++++++++++++
net/ipv6/route.c                      |    7 ++
11 files changed, 330 insertions(+), 0 deletions(-)
create mode 100644 include/linux/netfilter/xt_rpfilter.h
create mode 100644 net/ipv4/netfilter/ipt_rpfilter.c
create mode 100644 net/ipv6/netfilter/ip6t_rpfilter.c

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-12-05  8:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 22:19 [PATCH -next 0/4] netfilter reverse path filter matches Florian Westphal
2011-11-09 22:19 ` [PATCH nf-next 1/4] net: ipv4: export fib_lookup and fib_table_lookup Florian Westphal
2011-11-09 22:19 ` [PATCH nf-next 2/4] netfilter: add ipv4 reverse path filter match Florian Westphal
2011-11-09 22:19 ` [PATCH nf-next 3/4] ipv6: add ip6_route_lookup Florian Westphal
2011-11-09 22:19 ` [PATCH nf-next 4/4] netfilter: add ipv6 reverse path filter match Florian Westphal
2011-11-14  5:47 ` [PATCH -next 0/4] netfilter reverse path filter matches David Miller
2011-11-15  9:58   ` Pablo Neira Ayuso
2011-12-04 21:51 ` Pablo Neira Ayuso
2011-12-05  8:33   ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).