]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Correctly const-ify things.
authoradrian <adrian@FreeBSD.org>
Wed, 18 Mar 2015 04:40:36 +0000 (04:40 +0000)
committeradrian <adrian@FreeBSD.org>
Wed, 18 Mar 2015 04:40:36 +0000 (04:40 +0000)
Found by: clang 3.6

sys/netinet/in_rss.c

index 087d8467686b10d3246fcec072694cd38c8cd67e..264b6d7c2c83f74307cdadcb252c325f604cbedf 100644 (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);