| 2768 | } |
| 2769 | |
| 2770 | static int |
| 2771 | sysctl_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 | } |
| 2792 | out_locked: |
| 2793 | MFC_UNLOCK(); |
| 2794 | return (error); |
| 2795 | } |
| 2796 | |
| 2797 | static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mfctable, |
| 2798 | CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mfctable, |
nothing calls this directly
no test coverage detected