diff options
author | Edward Cree <ecree@solarflare.com> | 2018-07-02 16:14:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-04 14:06:20 +0900 |
commit | 17266ee939849cb095ed7dd9edbec4162172226b (patch) | |
tree | 63f620fc217d311860a46c913efa109fad89f4f6 /include/linux/netdevice.h | |
parent | 88eb1944e18c1ba61da538ae9d1732832eb79b9d (diff) | |
download | op-kernel-dev-17266ee939849cb095ed7dd9edbec4162172226b.zip op-kernel-dev-17266ee939849cb095ed7dd9edbec4162172226b.tar.gz |
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>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f67258f..c1ef749 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2297,6 +2297,9 @@ struct packet_type { struct net_device *, struct packet_type *, struct net_device *); + void (*list_func) (struct list_head *, + struct packet_type *, + struct net_device *); bool (*id_match)(struct packet_type *ptype, struct sock *sk); void *af_packet_priv; |