| 901 | } |
| 902 | |
| 903 | int |
| 904 | ipproto_unregister(short ipproto) |
| 905 | { |
| 906 | struct protosw *pr; |
| 907 | |
| 908 | /* Sanity checks. */ |
| 909 | if (ipproto <= 0 || ipproto >= IPPROTO_MAX) |
| 910 | return (EPROTONOSUPPORT); |
| 911 | |
| 912 | /* Check if the protocol was indeed registered. */ |
| 913 | pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); |
| 914 | if (pr == NULL) |
| 915 | return (EPFNOSUPPORT); |
| 916 | if (ip_protox[ipproto] == pr - inetsw) /* IPPROTO_RAW */ |
| 917 | return (ENOENT); |
| 918 | |
| 919 | /* Reset the protocol slot to IPPROTO_RAW. */ |
| 920 | ip_protox[ipproto] = pr - inetsw; |
| 921 | return (0); |
| 922 | } |
| 923 | |
| 924 | u_char inetctlerrmap[PRC_NCMDS] = { |
| 925 | 0, 0, 0, 0, |
no test coverage detected