* Return a pointer to mbuf/offset of location in mbuf chain. */
| 1253 | * Return a pointer to mbuf/offset of location in mbuf chain. |
| 1254 | */ |
| 1255 | struct mbuf * |
| 1256 | m_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" |
no outgoing calls
no test coverage detected