Correctly const-ify things.

Found by: clang 3.6
This commit is contained in:
Adrian Chadd 2015-03-18 04:40:36 +00:00
parent bc2e8d79c7
commit 3b27278218
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280202

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);