Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/route_ctl.c
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | for (int i = 0; i < RIB_MAX_RETRIES; i++) { | ||||
error = change_route_one(rnh, info, rc); | error = change_route_one(rnh, info, rc); | ||||
if (error != EAGAIN) | if (error != EAGAIN) | ||||
break; | break; | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | |||||
* Performs modification of routing table specificed by @action. | |||||
* Table is specified by @fibnum and sa_family in @info->rti_info[RTAX_DST]. | |||||
* Needs to be run in network epoch. | |||||
* | |||||
* Returns 0 on success and fills in @rc with action result. | |||||
*/ | |||||
int | |||||
rib_action(uint32_t fibnum, int action, struct rt_addrinfo *info, | |||||
struct rib_cmd_info *rc) | |||||
{ | |||||
int error; | |||||
switch (action) { | |||||
case RTM_ADD: | |||||
error = rib_add_route(fibnum, info, rc); | |||||
break; | |||||
case RTM_DELETE: | |||||
error = rib_del_route(fibnum, info, rc); | |||||
break; | |||||
case RTM_CHANGE: | |||||
error = rib_change_route(fibnum, info, rc); | |||||
break; | |||||
default: | |||||
error = ENOTSUP; | |||||
} | |||||
return (error); | |||||
} | |||||
static void | static void | ||||
rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info) | rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info) | ||||
{ | { | ||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
/* | /* | ||||
* give the protocol a chance to keep things in sync. | * give the protocol a chance to keep things in sync. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |