Lines Matching defs:buf_len
713 * @buf_len: the size of opt_buf
723 static int calipso_genopt(unsigned char *buf, u32 start, u32 buf_len,
735 if (buf_len <= start + pad + CALIPSO_HDR_LEN)
747 buf_len - start - pad - len);
912 unsigned int start, end, buf_len, pad, hop_len;
927 buf_len = hop_len + start - end + CALIPSO_OPT_LEN_MAX_WITH_PAD;
928 new = kzalloc(buf_len, GFP_ATOMIC);
934 ret_val = calipso_genopt((unsigned char *)new, start, buf_len, doi_def,
941 buf_len = start + ret_val;
942 /* At this point buf_len aligns to 4n, so (buf_len & 4) pads to 8n */
943 pad = ((buf_len & 4) + (end & 7)) & 7;
944 calipso_pad_write((unsigned char *)new, buf_len, pad);
945 buf_len += pad;
948 memcpy((char *)new + buf_len, (char *)hop + end, hop_len - end);
949 buf_len += hop_len - end;
952 new->hdrlen = buf_len / 8 - 1;