MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ip6_deletefraghdr

Function ip6_deletefraghdr

freebsd/netinet6/frag6.c:218–236  ·  view source on GitHub ↗

* Remove the IPv6 fragmentation header from the mbuf. */

Source from the content-addressed store, hash-verified

216 * Remove the IPv6 fragmentation header from the mbuf.
217 */
218int
219ip6_deletefraghdr(struct mbuf *m, int offset, int wait __unused)
220{
221 struct ip6_hdr *ip6;
222
223 KASSERT(m->m_len >= offset + sizeof(struct ip6_frag),
224 ("%s: ext headers not contigous in mbuf %p m_len %d >= "
225 "offset %d + %zu\n", __func__, m, m->m_len, offset,
226 sizeof(struct ip6_frag)));
227
228 /* Delete frag6 header. */
229 ip6 = mtod(m, struct ip6_hdr *);
230 bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), offset);
231 m->m_data += sizeof(struct ip6_frag);
232 m->m_len -= sizeof(struct ip6_frag);
233 m->m_flags |= M_FRAGMENTED;
234
235 return (0);
236}
237
238/*
239 * Free a fragment reassembly header and all associated datagrams.

Callers 2

pf_reassemble6Function · 0.85
frag6_inputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected