Changeset View
Changeset View
Standalone View
Standalone View
sys/net/rtsock.c
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | raw_input_rts_cb(struct mbuf *m, struct sockproto *proto, struct sockaddr *src, | ||||
/* Check if it is a rts and the fib matches the one of the socket. */ | /* Check if it is a rts and the fib matches the one of the socket. */ | ||||
fibnum = M_GETFIB(m); | fibnum = M_GETFIB(m); | ||||
if (proto->sp_family != PF_ROUTE || | if (proto->sp_family != PF_ROUTE || | ||||
rp->rcb_socket == NULL || | rp->rcb_socket == NULL || | ||||
rp->rcb_socket->so_fibnum == fibnum) | rp->rcb_socket->so_fibnum == fibnum) | ||||
return (0); | return (0); | ||||
/* Filtering requested and no match, the socket shall be skipped. */ | /* Filtering requested and no match, the socket shall be skipped. */ | ||||
glebius: Missing tab. | |||||
return (1); | return (1); | ||||
} | } | ||||
static void | static void | ||||
rts_input(struct mbuf *m) | rts_input(struct mbuf *m) | ||||
{ | { | ||||
struct sockproto route_proto; | struct sockproto route_proto; | ||||
unsigned short *family; | unsigned short *family; | ||||
▲ Show 20 Lines • Show All 825 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,577 Lines • Show Last 20 Lines |
Missing tab.