net: ipv4: listified version of ip_rcv
authorEdward Cree <ecree@solarflare.com>
Mon, 2 Jul 2018 15:14:12 +0000 (16:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jul 2018 05:06:20 +0000 (14:06 +0900)
commit17266ee939849cb095ed7dd9edbec4162172226b
tree63f620fc217d311860a46c913efa109fad89f4f6
parent88eb1944e18c1ba61da538ae9d1732832eb79b9d
net: ipv4: listified version of ip_rcv

Also involved adding a way to run a netfilter hook over a list of packets.
 Rather than attempting to make netfilter know about lists (which would be
 a major project in itself) we just let it call the regular okfn (in this
 case ip_rcv_finish()) for any packets it steals, and have it give us back
 a list of packets it's synchronously accepted (which normally NF_HOOK
 would automatically call okfn() on, but we want to be able to potentially
 pass the list to a listified version of okfn().)
The netfilter hooks themselves are indirect calls that still happen per-
 packet (see nf_hook_entry_hookfn()), but again, changing that can be left
 for future work.

There is potential for out-of-order receives if the netfilter hook ends up
 synchronously stealing packets, as they will be processed before any
 accepts earlier in the list.  However, it was already possible for an
 asynchronous accept to cause out-of-order receives, so presumably this is
 considered OK.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
include/linux/netfilter.h
include/net/ip.h
net/core/dev.c
net/ipv4/af_inet.c
net/ipv4/ip_input.c