469: /* don't allow broadcast messages to be fragmented */
470: if (ntohs(ip->ip_len) > ifp->if_mtu) {
471: error = EMSGSIZE;
496: unsigned int segsz = m->m_pkthdr.segsz;
497: unsigned int datasz = ntohs(ip->ip_len) - hlen;
498: unsigned int num = howmany(datasz, segsz);
511: /* Remember the current ip_len */
512: ip_len = ntohs(ip->ip_len);
513:
568: (sp->req->sav->natt_type & UDP_ENCAP_ESPINUDP_NON_IKE))) {
569: if (ntohs(ip->ip_len) > sp->req->sav->esp_frag) {
570: natt_frag = 1;
646: hlen = ip->ip_hl << 2;
647: ip_len = ntohs(ip->ip_len);
648:
701: (sp->req->sav->natt_type & UDP_ENCAP_ESPINUDP_NON_IKE))) {
702: if (ntohs(ip->ip_len) > sp->req->sav->esp_frag) {
703: natt_frag = 1;
769: hlen = ip->ip_hl << 2;
770: ip_len = ntohs(ip->ip_len);
771: #endif /* PFIL_HOOKS */
867: */
868: if (ntohs(ip->ip_off) & IP_DF) {
869: if (flags & IP_RETURNMTU)
888: ia->ia_ifa.ifa_data.ifad_outbytes +=
889: ntohs(ip->ip_len);
890: #endif
975: mhlen = sizeof (struct ip);
976: for (off = hlen + len; off < ntohs(ip->ip_len); off += len) {
977: MGETHDR(m, M_DONTWAIT, MT_HEADER);
996: mhip->ip_off = ((off - hlen) >> 3) +
997: (ntohs(ip->ip_off) & ~IP_MF);
998: if (ip->ip_off & htons(IP_MF))
999: mhip->ip_off |= IP_MF;
1000: if (off + len >= ntohs(ip->ip_len))
1001: len = ntohs(ip->ip_len) - off;
1002: else
1029: m = m0;
1030: m_adj(m, hlen + firstlen - ntohs(ip->ip_len));
1031: m->m_pkthdr.len = hlen + firstlen;
1078: offset = ip->ip_hl << 2;
1079: csum = in4_cksum(m, 0, offset, ntohs(ip->ip_len) - offset);
1080: if (csum == 0 && (m->m_pkthdr.csum_flags & M_CSUM_UDPv4) != 0)
1125: optlen = opt->m_len - sizeof(p->ipopt_dst);
1126: if (optlen + ntohs(ip->ip_len) > IP_MAXPACKET)
1127: return (m); /* XXX should fail */
1151: *phlen = sizeof(struct ip) + optlen;
1152: ip->ip_len = htons(ntohs(ip->ip_len) + optlen);
1153: return (m);