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

Function ip_destroy

freebsd/netinet/ip_input.c:379–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377
378#ifdef VIMAGE
379static void
380ip_destroy(void *unused __unused)
381{
382 int error;
383
384#ifdef RSS
385 netisr_unregister_vnet(&ip_direct_nh);
386#endif
387 netisr_unregister_vnet(&ip_nh);
388
389 pfil_head_unregister(V_inet_pfil_head);
390 error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET]);
391 if (error != 0) {
392 printf("%s: WARNING: unable to deregister input helper hook "
393 "type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET: "
394 "error %d returned\n", __func__, error);
395 }
396 error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET]);
397 if (error != 0) {
398 printf("%s: WARNING: unable to deregister output helper hook "
399 "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET: "
400 "error %d returned\n", __func__, error);
401 }
402
403 /* Remove the IPv4 addresses from all interfaces. */
404 in_ifscrub_all();
405
406 /* Make sure the IPv4 routes are gone as well. */
407 rib_flush_routes_family(AF_INET);
408
409 /* Destroy IP reassembly queue. */
410 ipreass_destroy();
411
412 /* Cleanup in_ifaddr hash table; should be empty. */
413 hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask);
414}
415
416VNET_SYSUNINIT(ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip_destroy, NULL);
417#endif

Callers

nothing calls this directly

Calls 8

netisr_unregister_vnetFunction · 0.85
pfil_head_unregisterFunction · 0.85
hhook_head_deregisterFunction · 0.85
in_ifscrub_allFunction · 0.85
rib_flush_routes_familyFunction · 0.85
ipreass_destroyFunction · 0.85
printfFunction · 0.50
hashdestroyFunction · 0.50

Tested by

no test coverage detected