diff options
Diffstat (limited to 'net/eth.c')
-rw-r--r-- | net/eth.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -405,17 +405,20 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags, struct ip6_ext_hdr *ext_hdr, struct in6_address *dst_addr) { - struct ip6_ext_hdr_routing *rthdr = (struct ip6_ext_hdr_routing *) ext_hdr; + struct ip6_ext_hdr_routing rt_hdr; size_t input_size = iov_size(pkt, pkt_frags); size_t bytes_read; - if (input_size < ext_hdr_offset + sizeof(*rthdr) + sizeof(*dst_addr)) { + if (input_size < ext_hdr_offset + sizeof(rt_hdr) + sizeof(*dst_addr)) { return false; } - if ((rthdr->rtype == 2) && (rthdr->segleft == 1)) { - bytes_read = iov_to_buf(pkt, pkt_frags, - ext_hdr_offset + sizeof(*rthdr), + bytes_read = iov_to_buf(pkt, pkt_frags, ext_hdr_offset, + &rt_hdr, sizeof(rt_hdr)); + assert(bytes_read == sizeof(rt_hdr)); + + if ((rt_hdr.rtype == 2) && (rt_hdr.segleft == 1)) { + bytes_read = iov_to_buf(pkt, pkt_frags, ext_hdr_offset + sizeof(rt_hdr), dst_addr, sizeof(*dst_addr)); return bytes_read == sizeof(*dst_addr); |