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

Function change_route

freebsd/net/route/route_ctl.c:1022–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020#endif
1021
1022static int
1023change_route(struct rib_head *rnh, struct rt_addrinfo *info,
1024 struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc)
1025{
1026 int error = 0;
1027 struct nhop_object *nh, *nh_orig;
1028 struct route_nhop_data rnd_new;
1029
1030 nh = NULL;
1031 nh_orig = rnd_orig->rnd_nhop;
1032 if (nh_orig == NULL)
1033 return (ESRCH);
1034
1035#ifdef ROUTE_MPATH
1036 if (NH_IS_NHGRP(nh_orig))
1037 return (change_mpath_route(rnh, info, rnd_orig, rc));
1038#endif
1039
1040 rnd_new.rnd_weight = get_info_weight(info, rnd_orig->rnd_weight);
1041 error = change_nhop(rnh, info, nh_orig, &rnd_new.rnd_nhop);
1042 if (error != 0)
1043 return (error);
1044 error = change_route_conditional(rnh, NULL, info, rnd_orig, &rnd_new, rc);
1045
1046 return (error);
1047}
1048
1049/*
1050 * Insert @rt with nhop data from @rnd_new to @rnh.

Callers 1

rib_change_routeFunction · 0.85

Calls 4

change_mpath_routeFunction · 0.85
get_info_weightFunction · 0.85
change_nhopFunction · 0.85
change_route_conditionalFunction · 0.85

Tested by

no test coverage detected