flow: Ignore invalid ICMPv6 fields when parsing packets
authorSimon Horman <simon.horman@netronome.com>
Thu, 13 Aug 2015 07:55:32 +0000 (16:55 +0900)
committerJesse Gross <jesse@nicira.com>
Thu, 13 Aug 2015 21:49:03 +0000 (14:49 -0700)
commitf8fe60beb18eab320456267f52b0267df425a76d
treead90fb2a442d691bdbfabfd2b5354d47a52818fc
parent97bab959f681bda2228a48330b246df8359f1e67
flow: Ignore invalid ICMPv6 fields when parsing packets

There is a miss-match between the handling of invalid ICMPv6 fields in the
implementations of parse_icmpv6() in user-space and in the kernel datapath.

This patch addresses that by modifying the user-space implementation to
match that of the kernel datapath; processing is terminated without
rather than with an error and partial information is cleared.

With these changes the user-space implementation of parse_icmpv6()
never returns an error. Accordingly the return type and caller have been
updated.

The original motivation for this is to allow matching the ICMPv6 type and
code of packets with invalid neighbour discovery options although only the
change around the '(!opt_len || opt_len > *sizep)' conditional is necessary
to achieve that goal.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
lib/flow.c