Lines Matching refs:ip_offset

1969 in_delayed_cksum_offset(struct mbuf *m0, int ip_offset)
1975 /* Save copy of first mbuf pointer and the ip_offset before modifying */
1977 int ip_offset_copy = ip_offset;
1979 while (ip_offset >= m->m_len) {
1980 ip_offset -= m->m_len;
1984 "ip_offset wasn't in the packet\n");
1993 if ((ip_offset + sizeof(struct ip) > m->m_len) ||
1994 !IP_HDR_ALIGNED_P(mtod(m, caddr_t) + ip_offset)) {
1997 m->m_len, ip_offset);
1999 m_copydata(m, ip_offset, sizeof(struct ip), (caddr_t) buf);
2003 ip = (struct ip*)(void *)(m->m_data + ip_offset);
2007 if (ip_offset) {
2008 m->m_len -= ip_offset;
2009 m->m_data += ip_offset;
2044 if (ip_offset) {
2045 if (M_LEADINGSPACE(m) < ip_offset)
2047 m->m_len += ip_offset;
2048 m->m_data -= ip_offset;
2055 if (offset + ip_offset + sizeof(u_short) > m->m_len) {
2060 m->m_len, offset + ip_offset, ip->ip_p);
2063 m_copyback(m, offset + ip_offset, 2, tmp);
2064 } else if (IP_HDR_ALIGNED_P(mtod(m, caddr_t) + ip_offset)) {
2065 *(u_short *)(void *)(m->m_data + offset + ip_offset) = csum;
2067 bcopy(&csum, (m->m_data + offset + ip_offset), sizeof (csum));
2078 in_cksum_offset(struct mbuf* m, size_t ip_offset)
2085 /* Save copy of first mbuf pointer and the ip_offset before modifying */
2087 size_t ip_offset_copy = ip_offset;
2089 while (ip_offset >= m->m_len) {
2090 ip_offset -= m->m_len;
2093 printf("in_cksum_offset failed - ip_offset wasn't "
2103 if ((ip_offset + sizeof(struct ip) > m->m_len) ||
2104 !IP_HDR_ALIGNED_P(mtod(m, caddr_t) + ip_offset)) {
2107 "off: %lu\n", m->m_len, ip_offset);
2109 m_copydata(m, ip_offset, sizeof(struct ip), (caddr_t) buf);
2113 m_copyback(m, ip_offset + offsetof(struct ip, ip_sum), 2,
2116 ip = (struct ip*)(void *)(m->m_data + ip_offset);
2121 if (ip_offset) {
2122 m->m_len -= ip_offset;
2123 m->m_data += ip_offset;
2159 if (ip_offset) {
2160 if (M_LEADINGSPACE(m) < ip_offset)
2162 m->m_len += ip_offset;
2163 m->m_data -= ip_offset;
2171 if (ip_offset + sizeof(struct ip) > m->m_len) {
2177 ip_offset + offsetof(struct ip, ip_sum), ip->ip_p);
2180 m_copyback(m, ip_offset + offsetof(struct ip, ip_sum), 2, tmp);
2181 } else if (!IP_HDR_ALIGNED_P(mtod(m, caddr_t) + ip_offset)) {
2183 (m->m_data + ip_offset + offsetof(struct ip, ip_sum)),