_eth_get_rss_ex_src_addr(const struct iovec *pkt, int pkt_frags,

                        size_t dsthdr_offset,

                        struct ip6_ext_hdr *ext_hdr,

                        struct in6_address *src_addr)

{

    size_t bytes_left = (ext_hdr->ip6r_len + 1) * 8 - sizeof(*ext_hdr);

    struct ip6_option_hdr opthdr;

    size_t opt_offset = dsthdr_offset + sizeof(*ext_hdr);



    while (bytes_left > sizeof(opthdr)) {

        size_t input_size = iov_size(pkt, pkt_frags);

        size_t bytes_read, optlen;



        if (input_size < opt_offset) {

            return false;

        }



        bytes_read = iov_to_buf(pkt, pkt_frags, opt_offset,

                                &opthdr, sizeof(opthdr));



        if (bytes_read != sizeof(opthdr)) {

            return false;

        }



        optlen = (opthdr.type == IP6_OPT_PAD1) ? 1

                                               : (opthdr.len + sizeof(opthdr));



        if (optlen > bytes_left) {

            return false;

        }



        if (opthdr.type == IP6_OPT_HOME) {

            size_t input_size = iov_size(pkt, pkt_frags);



            if (input_size < opt_offset + sizeof(opthdr)) {

                return false;

            }



            bytes_read = iov_to_buf(pkt, pkt_frags,

                                    opt_offset + sizeof(opthdr),

                                    src_addr, sizeof(*src_addr));



            return bytes_read == sizeof(src_addr);

        }



        opt_offset += optlen;

        bytes_left -= optlen;

    }



    return false;

}

_eth_get_rss_ex_src_addr(const struct iovec *pkt, int pkt_frags,

                        size_t dsthdr_offset,

                        struct ip6_ext_hdr *ext_hdr,

                        struct in6_address *src_addr)

{

    size_t bytes_left = (ext_hdr->ip6r_len + 1) * 8 - sizeof(*ext_hdr);

    struct ip6_option_hdr opthdr;

    size_t opt_offset = dsthdr_offset + sizeof(*ext_hdr);



    while (bytes_left > sizeof(opthdr)) {

        size_t input_size = iov_size(pkt, pkt_frags);

        size_t bytes_read, optlen;



        if (input_size < opt_offset) {

            return false;

        }



        bytes_read = iov_to_buf(pkt, pkt_frags, opt_offset,

                                &opthdr, sizeof(opthdr));



        if (bytes_read != sizeof(opthdr)) {

            return false;

        }



        optlen = (opthdr.type == IP6_OPT_PAD1) ? 1

                                               : (opthdr.len + sizeof(opthdr));



        if (optlen > bytes_left) {

            return false;

        }



        if (opthdr.type == IP6_OPT_HOME) {

            size_t input_size = iov_size(pkt, pkt_frags);



            if (input_size < opt_offset + sizeof(opthdr)) {

                return false;

            }



            bytes_read = iov_to_buf(pkt, pkt_frags,

                                    opt_offset + sizeof(opthdr),

                                    src_addr, sizeof(*src_addr));



            return bytes_read == sizeof(src_addr);

        }



        opt_offset += optlen;

        bytes_left -= optlen;

    }



    return false;

}

            return bytes_read == sizeof(src_addr);
FUNC_0(const struct iovec *VAR_0, int VAR_1,

                        size_t VAR_2,

                        struct ip6_ext_hdr *VAR_3,

                        struct in6_address *VAR_4)

{

    size_t bytes_left = (VAR_3->ip6r_len + 1) * 8 - sizeof(*VAR_3);

    struct ip6_option_hdr VAR_5;

    size_t opt_offset = VAR_2 + sizeof(*VAR_3);



    while (bytes_left > sizeof(VAR_5)) {

        size_t input_size = iov_size(VAR_0, VAR_1);

        size_t bytes_read, optlen;



        if (input_size < opt_offset) {

            return false;

        }



        bytes_read = iov_to_buf(VAR_0, VAR_1, opt_offset,

                                &VAR_5, sizeof(VAR_5));



        if (bytes_read != sizeof(VAR_5)) {

            return false;

        }



        optlen = (VAR_5.type == IP6_OPT_PAD1) ? 1

                                               : (VAR_5.len + sizeof(VAR_5));



        if (optlen > bytes_left) {

            return false;

        }



        if (VAR_5.type == IP6_OPT_HOME) {

            size_t input_size = iov_size(VAR_0, VAR_1);



            if (input_size < opt_offset + sizeof(VAR_5)) {

                return false;

            }



            bytes_read = iov_to_buf(VAR_0, VAR_1,

                                    opt_offset + sizeof(VAR_5),

                                    VAR_4, sizeof(*VAR_4));



            return bytes_read == sizeof(VAR_4);

        }



        opt_offset += optlen;

        bytes_left -= optlen;

    }



    return false;

}

FUNC_0(const struct iovec *VAR_0, int VAR_1,
size_t VAR_2,
struct ip6_ext_hdr *VAR_3,
struct in6_address *VAR_4)
{ size_t bytes_left = (VAR_3->ip6r_len + 1) * 8 - sizeof(*VAR_3); struct ip6_option_hdr VAR_5; size_t opt_offset = VAR_2 + sizeof(*VAR_3); while (bytes_left > sizeof(VAR_5)) { size_t input_size = iov_size(VAR_0, VAR_1); size_t bytes_read, optlen; if (input_size < opt_offset) { return false; } bytes_read = iov_to_buf(VAR_0, VAR_1, opt_offset,
&VAR_5, sizeof(VAR_5)); if (bytes_read != sizeof(VAR_5)) { return false; } optlen = (VAR_5.type == IP6_OPT_PAD1) ? 1
: (VAR_5.len + sizeof(VAR_5)); if (optlen > bytes_left) { return false; } if (VAR_5.type == IP6_OPT_HOME) { size_t input_size = iov_size(VAR_0, VAR_1); if (input_size < opt_offset + sizeof(VAR_5)) { return false; } bytes_read = iov_to_buf(VAR_0, VAR_1,
opt_offset + sizeof(VAR_5),
VAR_4, sizeof(*VAR_4)); return bytes_read == sizeof(VAR_4); } opt_offset += optlen; bytes_left -= optlen; } return false; }