net/eth: Check size earlier in _eth_get_rss_ex_dst_addr()
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
dbd8d3f959
commit
6f10f77dcd
|
@ -406,9 +406,6 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,
|
||||||
struct in6_address *dst_addr)
|
struct in6_address *dst_addr)
|
||||||
{
|
{
|
||||||
struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr;
|
struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr;
|
||||||
|
|
||||||
if ((rthdr->rtype == 2) && (rthdr->segleft == 1)) {
|
|
||||||
|
|
||||||
size_t input_size = iov_size(pkt, pkt_frags);
|
size_t input_size = iov_size(pkt, pkt_frags);
|
||||||
size_t bytes_read;
|
size_t bytes_read;
|
||||||
|
|
||||||
|
@ -416,6 +413,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((rthdr->rtype == 2) && (rthdr->segleft == 1)) {
|
||||||
bytes_read = iov_to_buf(pkt, pkt_frags,
|
bytes_read = iov_to_buf(pkt, pkt_frags,
|
||||||
ext_hdr_offset + sizeof(*rthdr),
|
ext_hdr_offset + sizeof(*rthdr),
|
||||||
dst_addr, sizeof(*dst_addr));
|
dst_addr, sizeof(*dst_addr));
|
||||||
|
|
Loading…
Reference in a new issue