alistair23-linux/net/bridge
Pablo Neira Ayuso 523b929d54 netfilter: nft_reject_bridge: don't use IP stack to reject traffic
If the packet is received via the bridge stack, this cannot reject
packets from the IP stack.

This adds functions to build the reject packet and send it from the
bridge stack. Comments and assumptions on this patch:

1) Validate the IPv4 and IPv6 headers before further processing,
   given that the packet comes from the bridge stack, we cannot assume
   they are clean. Truncated packets are dropped, we follow similar
   approach in the existing iptables match/target extensions that need
   to inspect layer 4 headers that is not available. This also includes
   packets that are directed to multicast and broadcast ethernet
   addresses.

2) br_deliver() is exported to inject the reject packet via
   bridge localout -> postrouting. So the approach is similar to what
   we already do in the iptables reject target. The reject packet is
   sent to the bridge port from which we have received the original
   packet.

3) The reject packet is forged based on the original packet. The TTL
   is set based on sysctl_ip_default_ttl for IPv4 and per-net
   ipv6.devconf_all hoplimit for IPv6.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2014-10-31 12:50:08 +01:00
..
netfilter netfilter: nft_reject_bridge: don't use IP stack to reject traffic 2014-10-31 12:50:08 +01:00
br.c netfilter: bridge: move br_netfilter out of the core 2014-09-26 18:42:31 +02:00
br_device.c bridge: Add filtering support for default_pvid 2014-10-05 21:21:37 -04:00
br_fdb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-08-05 18:46:26 -07:00
br_forward.c netfilter: nft_reject_bridge: don't use IP stack to reject traffic 2014-10-31 12:50:08 +01:00
br_if.c bridge: Add filtering support for default_pvid 2014-10-05 21:21:37 -04:00
br_input.c netfilter: bridge: move br_netfilter out of the core 2014-09-26 18:42:31 +02:00
br_ioctl.c bridge: add space before '(/{', after ',', etc. 2013-12-19 19:27:26 -05:00
br_mdb.c bridge: rename struct bridge_mcast_query/querier 2014-06-10 23:50:46 -07:00
br_multicast.c br_multicast: Replace rcu_assign_pointer() with RCU_INIT_POINTER() 2014-08-22 12:23:11 -07:00
br_netfilter.c bridge: Do not compile options in br_parse_ip_options 2014-10-24 14:24:03 +02:00
br_netlink.c net: bridge: add a br_set_state helper function 2014-10-01 22:03:50 -04:00
br_nf_core.c netfilter: bridge: move br_netfilter out of the core 2014-09-26 18:42:31 +02:00
br_private.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-10-08 16:22:22 -04:00
br_private_stp.h
br_stp.c net: bridge: add a br_set_state helper function 2014-10-01 22:03:50 -04:00
br_stp_bpdu.c
br_stp_if.c net: bridge: add a br_set_state helper function 2014-10-01 22:03:50 -04:00
br_stp_timer.c net: bridge: add a br_set_state helper function 2014-10-01 22:03:50 -04:00
br_sysfs_br.c bridge: Add a default_pvid sysfs attribute 2014-10-05 21:21:36 -04:00
br_sysfs_if.c bridge: Keep track of ports capable of automatic discovery. 2014-05-16 17:06:33 -04:00
br_vlan.c bridge: Add filtering support for default_pvid 2014-10-05 21:21:37 -04:00
Kconfig
Makefile netfilter: bridge: build br_nf_core only if required 2014-09-30 14:07:51 -04:00