Message ID | 1566466214-45330-1-git-send-email-Yanqin.Wei@arm.com |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev,v1] flow: fix incorrect padding length checking and combine branch in ipv6_sanity_check | expand |
Bleep bloop. Greetings Yanqin Wei, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: ERROR: Remove Gerrit Change-Id's before submitting upstream. 8: Change-Id: I7a6212872f89ef9c11e3fbcec4dbecbcc6e89c47 Lines checked: 45, Warnings: 0, Errors: 1 Please check this out. If you feel there has been an error, please email aconole@redhat.com Thanks, 0-day Robot
diff --git a/lib/flow.c b/lib/flow.c index e5b554b..1b21f51 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -688,18 +688,16 @@ ipv4_get_nw_frag(const struct ip_header *nh) static inline bool ipv6_sanity_check(const struct ovs_16aligned_ip6_hdr *nh, size_t size) { - uint16_t plen; + int pad_len; if (OVS_UNLIKELY(size < sizeof *nh)) { return false; } - plen = ntohs(nh->ip6_plen); - if (OVS_UNLIKELY(plen + IPV6_HEADER_LEN > size)) { - return false; - } + pad_len = size - IPV6_HEADER_LEN - ntohs(nh->ip6_plen); + /* Jumbo Payload option not supported yet. */ - if (OVS_UNLIKELY(size - plen > UINT8_MAX)) { + if (OVS_UNLIKELY(pad_len < 0 || pad_len > UINT8_MAX)) { return false; }