Changeset View
Changeset View
Standalone View
Standalone View
sys/net/rtsock.c
Show First 20 Lines • Show All 668 Lines • ▼ Show 20 Lines | if (info.rti_info[RTAX_GATEWAY] != NULL && | ||||
} | } | ||||
} | } | ||||
switch (rtm->rtm_type) { | switch (rtm->rtm_type) { | ||||
struct rtentry *saved_nrt; | struct rtentry *saved_nrt; | ||||
case RTM_ADD: | case RTM_ADD: | ||||
case RTM_CHANGE: | case RTM_CHANGE: | ||||
if (rtm->rtm_type == RTM_ADD) { | |||||
if (info.rti_info[RTAX_GATEWAY] == NULL) | if (info.rti_info[RTAX_GATEWAY] == NULL) | ||||
senderr(EINVAL); | senderr(EINVAL); | ||||
} | |||||
saved_nrt = NULL; | saved_nrt = NULL; | ||||
/* support for new ARP code */ | /* support for new ARP code */ | ||||
if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK && | if (info.rti_info[RTAX_GATEWAY] != NULL && | ||||
info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK && | |||||
(rtm->rtm_flags & RTF_LLDATA) != 0) { | (rtm->rtm_flags & RTF_LLDATA) != 0) { | ||||
error = lla_rt_output(rtm, &info); | error = lla_rt_output(rtm, &info); | ||||
#ifdef INET6 | #ifdef INET6 | ||||
if (error == 0) | if (error == 0) | ||||
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; | rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; | ||||
#endif | #endif | ||||
break; | break; | ||||
} | } | ||||
error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, | error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, | ||||
fibnum); | fibnum); | ||||
if (error == 0 && saved_nrt != NULL) { | if (error == 0 && saved_nrt != NULL) { | ||||
#ifdef INET6 | #ifdef INET6 | ||||
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; | rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; | ||||
#endif | #endif | ||||
RT_LOCK(saved_nrt); | RT_LOCK(saved_nrt); | ||||
rtm->rtm_index = saved_nrt->rt_ifp->if_index; | rtm->rtm_index = saved_nrt->rt_ifp->if_index; | ||||
▲ Show 20 Lines • Show All 1,269 Lines • Show Last 20 Lines |