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

Function lltable_free

freebsd/net/if_llatbl.c:489–514  ·  view source on GitHub ↗

* Free all entries from given table and free itself. */

Source from the content-addressed store, hash-verified

487 * Free all entries from given table and free itself.
488 */
489void
490lltable_free(struct lltable *llt)
491{
492 struct llentry *lle, *next;
493 struct llentries dchain;
494
495 KASSERT(llt != NULL, ("%s: llt is NULL", __func__));
496
497 lltable_unlink(llt);
498
499 CK_LIST_INIT(&dchain);
500 IF_AFDATA_WLOCK(llt->llt_ifp);
501 /* Push all lles to @dchain */
502 lltable_foreach_lle(llt, lltable_free_cb, &dchain);
503 llentries_unlink(llt, &dchain);
504 IF_AFDATA_WUNLOCK(llt->llt_ifp);
505
506 CK_LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) {
507 llentry_free(lle);
508 }
509
510 KASSERT(llt->llt_entries == 0, ("%s: lltable %p (%s) entires not 0: %d",
511 __func__, llt, llt->llt_ifp->if_xname, llt->llt_entries));
512
513 llt->llt_free_tbl(llt);
514}
515
516/*
517 * Deletes an address from given lltable.

Callers 2

in_domifdetachFunction · 0.85
in6_domifdetachFunction · 0.85

Calls 4

lltable_unlinkFunction · 0.85
lltable_foreach_lleFunction · 0.85
llentries_unlinkFunction · 0.85
llentry_freeFunction · 0.85

Tested by

no test coverage detected