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

Function sysctl_mfctable

freebsd/netinet/ip_mroute.c:2770–2795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2768}
2769
2770static int
2771sysctl_mfctable(SYSCTL_HANDLER_ARGS)
2772{
2773 struct mfc *rt;
2774 int error, i;
2775
2776 if (req->newptr)
2777 return (EPERM);
2778 if (V_mfchashtbl == NULL) /* XXX unlocked */
2779 return (0);
2780 error = sysctl_wire_old_buffer(req, 0);
2781 if (error)
2782 return (error);
2783
2784 MFC_LOCK();
2785 for (i = 0; i < mfchashsize; i++) {
2786 LIST_FOREACH(rt, &V_mfchashtbl[i], mfc_hash) {
2787 error = SYSCTL_OUT(req, rt, sizeof(struct mfc));
2788 if (error)
2789 goto out_locked;
2790 }
2791 }
2792out_locked:
2793 MFC_UNLOCK();
2794 return (error);
2795}
2796
2797static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mfctable,
2798 CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mfctable,

Callers

nothing calls this directly

Calls 1

sysctl_wire_old_bufferFunction · 0.85

Tested by

no test coverage detected