* Remove all hosts associated with a specific link from the hashtable. * If linkNum == -1, then remove all hosts in the table. */
| 994 | * If linkNum == -1, then remove all hosts in the table. |
| 995 | */ |
| 996 | static void |
| 997 | ng_bridge_remove_hosts(priv_p priv, link_p link) |
| 998 | { |
| 999 | int bucket; |
| 1000 | |
| 1001 | for (bucket = 0; bucket < priv->numBuckets; bucket++) { |
| 1002 | struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); |
| 1003 | |
| 1004 | while (*hptr != NULL) { |
| 1005 | struct ng_bridge_hent *const hent = *hptr; |
| 1006 | |
| 1007 | if (link == NULL || hent->host.link == link) { |
| 1008 | *hptr = SLIST_NEXT(hent, next); |
| 1009 | free(hent, M_NETGRAPH_BRIDGE); |
| 1010 | priv->numHosts--; |
| 1011 | } else |
| 1012 | hptr = &SLIST_NEXT(hent, next); |
| 1013 | } |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | /* |
| 1018 | * Handle our once-per-second timeout event. We do two things: |
no test coverage detected