Revision 523b929d5446c023e1219aa81455a8c766cac883 authored by Pablo Neira Ayuso on 25 October 2014, 16:40:26 UTC, committed by Pablo Neira Ayuso on 31 October 2014, 11:50:08 UTC
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>
1 parent 8bfcdf6
History
File Mode Size
Kconfig -rw-r--r-- 2.9 KB
Makefile -rw-r--r-- 538 bytes
extcon-adc-jack.c -rw-r--r-- 4.9 KB
extcon-arizona.c -rw-r--r-- 37.6 KB
extcon-class.c -rw-r--r-- 27.6 KB
extcon-gpio.c -rw-r--r-- 5.0 KB
extcon-max14577.c -rw-r--r-- 22.2 KB
extcon-max77693.c -rw-r--r-- 37.4 KB
extcon-max8997.c -rw-r--r-- 20.8 KB
extcon-palmas.c -rw-r--r-- 9.2 KB
extcon-rt8973a.c -rw-r--r-- 19.7 KB
extcon-rt8973a.h -rw-r--r-- 8.1 KB
extcon-sm5502.c -rw-r--r-- 19.3 KB
extcon-sm5502.h -rw-r--r-- 10.9 KB

back to top