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

Function ng_pptpgre_sendq

freebsd/netgraph/ng_pptpgre.c:722–739  ·  view source on GitHub ↗

* Delivers packets from the queue "q" to upper layers. Frees delivered * entries with the exception of one equal to "st" that is allocated * on caller's stack and not on the heap. */

Source from the content-addressed store, hash-verified

720 * on caller's stack and not on the heap.
721 */
722static int
723ng_pptpgre_sendq(const hpriv_p hpriv, roqh *q, const struct ng_pptpgre_roq *st)
724{
725 struct ng_pptpgre_roq *np;
726 struct mbuf *m;
727 int error = 0;
728
729 mtx_assert(&hpriv->mtx, MA_NOTOWNED);
730 while (!SLIST_EMPTY(q)) {
731 np = SLIST_FIRST(q);
732 SLIST_REMOVE_HEAD(q, next);
733 NGI_GET_M(np->item, m);
734 NG_FWD_NEW_DATA(error, np->item, hpriv->hook, m);
735 if (np != st)
736 free(np, M_NETGRAPH);
737 }
738 return (error);
739}
740
741/*
742 * Handle an incoming packet. The packet includes the IP header.

Callers 2

ng_pptpgre_rcvdata_lowerFunction · 0.85

Calls 2

mtx_assertFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected