Changeset View
Changeset View
Standalone View
Standalone View
sys/net/rtsock.c
Show First 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
rts_append_data(struct socket *so, struct mbuf *m) | rts_append_data(struct socket *so, struct mbuf *m) | ||||
{ | { | ||||
if (sbappendaddr(&so->so_rcv, &route_src, m, NULL) == 0) { | if (sbappendaddr(&so->so_rcv, &route_src, m, NULL) == 0) { | ||||
soroverflow(so); | soroverflow(so); | ||||
m_freem(m); | m_freem(m); | ||||
} else | } else | ||||
glebius: Missing tab. | |||||
sorwakeup(so); | sorwakeup(so); | ||||
} | } | ||||
static void | static void | ||||
rts_input(struct mbuf *m) | rts_input(struct mbuf *m) | ||||
{ | { | ||||
struct rcb *rcb; | struct rcb *rcb; | ||||
struct socket *last; | struct socket *last; | ||||
▲ Show 20 Lines • Show All 773 Lines • ▼ Show 20 Lines | case RTM_CHANGE: | ||||
if (rtm->rtm_type == RTM_ADD) { | if (rtm->rtm_type == RTM_ADD) { | ||||
if (info.rti_info[RTAX_GATEWAY] == NULL) { | if (info.rti_info[RTAX_GATEWAY] == NULL) { | ||||
RTS_PID_LOG(LOG_DEBUG, "RTM_ADD w/o gateway"); | RTS_PID_LOG(LOG_DEBUG, "RTM_ADD w/o gateway"); | ||||
senderr(EINVAL); | senderr(EINVAL); | ||||
} | } | ||||
} | } | ||||
error = rib_action(fibnum, rtm->rtm_type, &info, &rc); | error = rib_action(fibnum, rtm->rtm_type, &info, &rc); | ||||
if (error == 0) { | if (error == 0) { | ||||
rib_bridge_rt_event(NLBR_PROVIDER_RTSOCK, fibnum, &info, &rc); | |||||
#ifdef ROUTE_MPATH | #ifdef ROUTE_MPATH | ||||
if (NH_IS_NHGRP(rc.rc_nh_new) || | if (NH_IS_NHGRP(rc.rc_nh_new) || | ||||
(rc.rc_nh_old && NH_IS_NHGRP(rc.rc_nh_old))) { | (rc.rc_nh_old && NH_IS_NHGRP(rc.rc_nh_old))) { | ||||
struct rib_cmd_info rc_simple = {}; | struct rib_cmd_info rc_simple = {}; | ||||
rib_decompose_notification(&rc, | rib_decompose_notification(&rc, | ||||
save_add_notification, (void *)&rc_simple); | save_add_notification, (void *)&rc_simple); | ||||
rc = rc_simple; | rc = rc_simple; | ||||
} | } | ||||
#endif | #endif | ||||
/* nh MAY be empty if RTM_CHANGE request is no-op */ | /* nh MAY be empty if RTM_CHANGE request is no-op */ | ||||
nh = rc.rc_nh_new; | nh = rc.rc_nh_new; | ||||
if (nh != NULL) { | if (nh != NULL) { | ||||
rtm->rtm_index = nh->nh_ifp->if_index; | rtm->rtm_index = nh->nh_ifp->if_index; | ||||
rtm->rtm_flags = rc.rc_rt->rte_flags | nhop_get_rtflags(nh); | rtm->rtm_flags = rc.rc_rt->rte_flags | nhop_get_rtflags(nh); | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
case RTM_DELETE: | case RTM_DELETE: | ||||
error = rib_action(fibnum, RTM_DELETE, &info, &rc); | error = rib_action(fibnum, RTM_DELETE, &info, &rc); | ||||
if (error == 0) { | if (error == 0) { | ||||
rib_bridge_rt_event(NLBR_PROVIDER_RTSOCK, fibnum, &info, &rc); | |||||
#ifdef ROUTE_MPATH | #ifdef ROUTE_MPATH | ||||
if (NH_IS_NHGRP(rc.rc_nh_old) || | if (NH_IS_NHGRP(rc.rc_nh_old) || | ||||
(rc.rc_nh_new && NH_IS_NHGRP(rc.rc_nh_new))) { | (rc.rc_nh_new && NH_IS_NHGRP(rc.rc_nh_new))) { | ||||
struct rib_cmd_info rc_simple = {}; | struct rib_cmd_info rc_simple = {}; | ||||
rib_decompose_notification(&rc, | rib_decompose_notification(&rc, | ||||
save_del_notification, (void *)&rc_simple); | save_del_notification, (void *)&rc_simple); | ||||
rc = rc_simple; | rc = rc_simple; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,571 Lines • Show Last 20 Lines |
Missing tab.