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

Function ip6proto_unregister

freebsd/netinet6/ip6_input.c:328–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328int
329ip6proto_unregister(short ip6proto)
330{
331 struct protosw *pr;
332
333 /* Sanity checks. */
334 if (ip6proto <= 0 || ip6proto >= IPPROTO_MAX)
335 return (EPROTONOSUPPORT);
336
337 /* Check if the protocol was indeed registered. */
338 pr = pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW);
339 if (pr == NULL)
340 return (EPFNOSUPPORT);
341 if (ip6_protox[ip6proto] == pr - inet6sw) /* IPPROTO_RAW */
342 return (ENOENT);
343
344 /* Reset the protocol slot to IPPROTO_RAW. */
345 ip6_protox[ip6proto] = pr - inet6sw;
346 return (0);
347}
348
349#ifdef VIMAGE
350static void

Callers 2

carp_mod_cleanupFunction · 0.85
sctp_module_unloadFunction · 0.85

Calls 1

pffindprotoFunction · 0.85

Tested by

no test coverage detected