Skip to content

Commit

Permalink
flow: fix incorrect padding length checking in ipv6_sanity_check
Browse files Browse the repository at this point in the history
The padding length is (packet size - ipv6 header length - ipv6 plen).  This
patch fixes incorrect padding size checking in ipv6_sanity_check.

Acked-by: William Tu <u9012063@gmail.com>
Reviewed-by: Gavin Hu <Gavin.Hu@arm.com>
Signed-off-by: Yanqin Wei <Yanqin.Wei@arm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
Yanqin Wei authored and blp committed Sep 25, 2019
1 parent 1f82d15 commit 3c22f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/flow.c
Expand Up @@ -699,7 +699,7 @@ ipv6_sanity_check(const struct ovs_16aligned_ip6_hdr *nh, size_t size)
return false;
}
/* Jumbo Payload option not supported yet. */
if (OVS_UNLIKELY(size - plen > UINT8_MAX)) {
if (OVS_UNLIKELY(size - (plen + IPV6_HEADER_LEN) > UINT8_MAX)) {
return false;
}

Expand Down

0 comments on commit 3c22f70

Please sign in to comment.