Correctly const-ify things.

Found by: clang 3.6
This commit is contained in:
adrian 2015-03-18 04:40:36 +00:00
parent 04c509cb94
commit 2df37847f5

View File

@ -283,7 +283,7 @@ rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval,
printf("%s: short TCP frame?\n", __func__);
return (-1);
}
th = (struct tcphdr *)((caddr_t)ip + iphlen);
th = (const struct tcphdr *)((c_caddr_t)ip + iphlen);
return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst,
th->th_sport,
th->th_dport,
@ -293,7 +293,7 @@ rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval,
} else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4) &&
(proto == IPPROTO_UDP) &&
(is_frag == 0)) {
uh = (struct udphdr *)((caddr_t)ip + iphlen);
uh = (const struct udphdr *)((c_caddr_t)ip + iphlen);
if (m->m_len < iphlen + sizeof(struct udphdr)) {
printf("%s: short UDP frame?\n", __func__);
return (-1);