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

Function ng_bridge_unmute

freebsd/netgraph/ng_bridge.c:1023–1041  ·  view source on GitHub ↗

* Handle our once-per-second timeout event. We do two things: * we decrement link->loopCount for those links being muted due to * a detected loopback condition, and we remove any hosts from * the hashtable whom we haven't heard from in a long while. */

Source from the content-addressed store, hash-verified

1021 * the hashtable whom we haven't heard from in a long while.
1022 */
1023static int
1024ng_bridge_unmute(hook_p hook, void *arg)
1025{
1026 link_p link = NG_HOOK_PRIVATE(hook);
1027 node_p node = NG_HOOK_NODE(hook);
1028 priv_p priv = NG_NODE_PRIVATE(node);
1029 int *counter = arg;
1030
1031 if (link->loopCount != 0) {
1032 link->loopCount--;
1033 if (link->loopCount == 0 && priv->conf.debugLevel >= 2) {
1034 log(LOG_INFO, "ng_bridge: %s:"
1035 " restoring looped back %s\n",
1036 ng_bridge_nodename(node), NG_HOOK_NAME(hook));
1037 }
1038 }
1039 (*counter)++;
1040 return (1);
1041}
1042
1043static void
1044ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2)

Callers

nothing calls this directly

Calls 2

ng_bridge_nodenameFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected