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

Function m_getptr

freebsd/kern/uipc_mbuf.c:1255–1278  ·  view source on GitHub ↗

* Return a pointer to mbuf/offset of location in mbuf chain. */

Source from the content-addressed store, hash-verified

1253 * Return a pointer to mbuf/offset of location in mbuf chain.
1254 */
1255struct mbuf *
1256m_getptr(struct mbuf *m, int loc, int *off)
1257{
1258
1259 while (loc >= 0) {
1260 /* Normal end of search. */
1261 if (m->m_len > loc) {
1262 *off = loc;
1263 return (m);
1264 } else {
1265 loc -= m->m_len;
1266 if (m->m_next == NULL) {
1267 if (loc == 0) {
1268 /* Point at the end of valid data. */
1269 *off = m->m_len;
1270 return (m);
1271 }
1272 return (NULL);
1273 }
1274 m = m->m_next;
1275 }
1276 }
1277 return (NULL);
1278}
1279
1280#pragma GCC diagnostic ignored "-Wformat"
1281#pragma GCC diagnostic ignored "-Wformat-extra-args"

Callers 11

pf_reassemble6Function · 0.85
pf_refragment6Function · 0.85
mld_dispatch_packetFunction · 0.85
m_contiguous_subsegmentFunction · 0.85
close_flowsetFunction · 0.85
m_striphdrFunction · 0.85
m_checkalignmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected