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

Function ipproto_unregister

freebsd/netinet/ip_input.c:903–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

901}
902
903int
904ipproto_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
924u_char inetctlerrmap[PRC_NCMDS] = {
925 0, 0, 0, 0,

Callers 3

pfsync_uninitFunction · 0.85
carp_mod_cleanupFunction · 0.85
sctp_module_unloadFunction · 0.85

Calls 1

pffindprotoFunction · 0.85

Tested by

no test coverage detected