OSDN Git Service

bpf: Add mtu checking to FIB forwarding helper
authorDavid Ahern <dsahern@gmail.com>
Mon, 21 May 2018 16:08:15 +0000 (09:08 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 22 May 2018 08:51:09 +0000 (10:51 +0200)
commit4f74fede40df8dbdb5261d50682491126675aac3
tree70615666ccc5c415f02efde857a8bb800a11791f
parent901731b882d77dc53897aec45015ced42d56fe4c
bpf: Add mtu checking to FIB forwarding helper

Add check that egress MTU can handle packet to be forwarded. If
the MTU is less than the packet length, return 0 meaning the
packet is expected to continue up the stack for help - eg.,
fragmenting the packet or sending an ICMP.

The XDP path needs to leverage the FIB entry for an MTU on the
route spec or an exception entry for a given destination. The
skb path lets is_skb_forwardable decide if the packet can be
sent.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c