Skip to content

Commit

Permalink
net/eth: Check iovec has enough data earlier
Browse files Browse the repository at this point in the history
We want to check fields from ip6_ext_hdr_routing structure
and if correct read the full in6_address. Let's directly check
if our iovec contains enough data for everything, else return
early.

Suggested-by: Stefano Garzarella <[email protected]>
Reviewed-by: Miroslav Rezanina <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
  • Loading branch information
philmd authored and jasowang committed Mar 22, 2021
1 parent 6f10f77 commit ef76358
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,
size_t input_size = iov_size(pkt, pkt_frags);
size_t bytes_read;

if (input_size < ext_hdr_offset + sizeof(*ext_hdr)) {
if (input_size < ext_hdr_offset + sizeof(*rthdr) + sizeof(*dst_addr)) {
return false;
}

Expand Down

0 comments on commit ef76358

Please sign in to comment.