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

Function del_route

freebsd/net/route/route_ctl.c:826–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824}
825
826static int
827del_route(struct rib_head *rnh, struct rt_addrinfo *info,
828 struct rib_cmd_info *rc)
829{
830 int error;
831
832 RIB_WLOCK(rnh);
833 error = rt_unlinkrte(rnh, info, rc);
834 RIB_WUNLOCK(rnh);
835 if (error != 0)
836 return (error);
837
838 rib_notify(rnh, RIB_NOTIFY_DELAYED, rc);
839
840 /*
841 * If the caller wants it, then it can have it,
842 * the entry will be deleted after the end of the current epoch.
843 */
844 if (rc->rc_cmd == RTM_DELETE)
845 rtfree(rc->rc_rt);
846#ifdef ROUTE_MPATH
847 else {
848 /*
849 * Deleting 1 path may result in RTM_CHANGE to
850 * a different mpath group/nhop.
851 * Free old mpath group.
852 */
853 nhop_free_any(rc->rc_nh_old);
854 }
855#endif
856
857 return (0);
858}
859
860int
861rib_change_route(uint32_t fibnum, struct rt_addrinfo *info,

Callers 1

rib_del_routeFunction · 0.85

Calls 4

rt_unlinkrteFunction · 0.85
rib_notifyFunction · 0.85
rtfreeFunction · 0.85
nhop_free_anyFunction · 0.85

Tested by

no test coverage detected