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

Function destroy_rtentry

freebsd/net/route/route_ctl.c:130–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128#endif
129
130static void
131destroy_rtentry(struct rtentry *rt)
132{
133#ifdef VIMAGE
134 struct nhop_object *nh = rt->rt_nhop;
135
136 /*
137 * At this moment rnh, nh_control may be already freed.
138 * nhop interface may have been migrated to a different vnet.
139 * Use vnet stored in the nexthop to delete the entry.
140 */
141#ifdef ROUTE_MPATH
142 if (NH_IS_NHGRP(nh)) {
143 struct weightened_nhop *wn;
144 uint32_t num_nhops;
145 wn = nhgrp_get_nhops((struct nhgrp_object *)nh, &num_nhops);
146 nh = wn[0].nh;
147 }
148#endif
149 CURVNET_SET(nhop_get_vnet(nh));
150#endif
151
152 /* Unreference nexthop */
153 nhop_free_any(rt->rt_nhop);
154
155 uma_zfree(V_rtzone, rt);
156
157 CURVNET_RESTORE();
158}
159
160/*
161 * Epoch callback indicating rtentry is safe to destroy

Callers 1

destroy_rtentry_epochFunction · 0.85

Calls 4

nhop_get_vnetFunction · 0.85
nhop_free_anyFunction · 0.85
nhgrp_get_nhopsFunction · 0.70
uma_zfreeFunction · 0.50

Tested by

no test coverage detected