kern.c (mrouted-4.3) | : | kern.c (mrouted-4.4) | ||
---|---|---|---|---|
skipping to change at line 230 | skipping to change at line 230 | |||
/* | /* | |||
* Add a virtual interface in the kernel. | * Add a virtual interface in the kernel. | |||
*/ | */ | |||
void k_add_vif(vifi_t vifi, struct uvif *v) | void k_add_vif(vifi_t vifi, struct uvif *v) | |||
{ | { | |||
struct vifctl vc; | struct vifctl vc; | |||
vc.vifc_vifi = vifi; | vc.vifc_vifi = vifi; | |||
uvif_to_vifctl(&vc, v); | uvif_to_vifctl(&vc, v); | |||
if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_VIF, &vc, sizeof(vc)) < 0) | if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_VIF, &vc, sizeof(vc)) < 0) { | |||
#ifdef __linux__ | ||||
int olderrno = errno; | ||||
if ((v->uv_flags & VIFF_TUNNEL) && errno == ENOBUFS) | ||||
logit(LOG_WARNING, 0, "Failed installing tunnel VIF. Missing ipip.ko | ||||
module?"); | ||||
errno = olderrno; | ||||
#endif | ||||
logit(LOG_ERR, errno, "Failed MRT_ADD_VIF(%d) for %s", vifi, v->uv_name); | logit(LOG_ERR, errno, "Failed MRT_ADD_VIF(%d) for %s", vifi, v->uv_name); | |||
} | ||||
} | } | |||
/* | /* | |||
* Delete a virtual interface in the kernel. | * Delete a virtual interface in the kernel. | |||
*/ | */ | |||
void k_del_vif(vifi_t vifi, struct uvif *v) | void k_del_vif(vifi_t vifi, struct uvif *v) | |||
{ | { | |||
/* | /* | |||
* Unfortunately Linux setsocopt MRT_DEL_VIF API differs a bit from the *BSD one. | * Unfortunately Linux setsocopt MRT_DEL_VIF API differs a bit from the *BSD one. | |||
* It expects to receive a pointer to struct vifctl that corresponds to the VIF | * It expects to receive a pointer to struct vifctl that corresponds to the VIF | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added |