Lines Matching refs:optlen
1001 unsigned optlen; in ip_insertoptions() local
1003 optlen = opt->m_len - sizeof(p->ipopt_dst); in ip_insertoptions()
1004 KASSERT(optlen % 4 == 0); in ip_insertoptions()
1005 if (optlen + ntohs(ip->ip_len) > IP_MAXPACKET) in ip_insertoptions()
1009 if (M_READONLY(m) || M_LEADINGSPACE(m) < optlen) { in ip_insertoptions()
1018 n->m_len = optlen + sizeof(struct ip); in ip_insertoptions()
1023 m->m_data -= optlen; in ip_insertoptions()
1024 m->m_len += optlen; in ip_insertoptions()
1027 m->m_pkthdr.len += optlen; in ip_insertoptions()
1029 memcpy(ip + 1, p->ipopt_list, optlen); in ip_insertoptions()
1030 *phlen = sizeof(struct ip) + optlen; in ip_insertoptions()
1031 ip->ip_len = htons(ntohs(ip->ip_len) + optlen); in ip_insertoptions()
1043 int opt, optlen, cnt; in ip_optcopy() local
1048 for (; cnt > 0; cnt -= optlen, cp += optlen) { in ip_optcopy()
1055 optlen = 1; in ip_optcopy()
1060 optlen = cp[IPOPT_OLEN]; in ip_optcopy()
1061 KASSERT(optlen >= IPOPT_OLEN + sizeof(*cp) && optlen < cnt); in ip_optcopy()
1064 if (optlen > cnt) in ip_optcopy()
1065 optlen = cnt; in ip_optcopy()
1067 bcopy((void *)cp, (void *)dp, (unsigned)optlen); in ip_optcopy()
1068 dp += optlen; in ip_optcopy()
1072 for (optlen = dp - (u_char *)(ipdst+1); optlen & 0x3; optlen++) { in ip_optcopy()
1076 return optlen; in ip_optcopy()