[OpenWrt-Devel] [6relayd] Crash when timerfd_create is not enabled

2013-06-19 Thread Hans Dedecker
When timerfd_create is not enabled in the Linux kernel the 6relayd daemon
crashes when the router advertisement message timer expires.
This is caused by not checking the parameter socket in the code below in
the file router.c line 76
for (size_t i = 0; i  config-slavecount; ++i) {
struct relayd_interface *iface = config-slaves[i];
iface-timer_rs.socket = timerfd_create(CLOCK_MONOTONIC,
TFD_CLOEXEC | TFD_NONBLOCK);
iface-timer_rs.handle_event = send_router_advert;
relayd_register_event(iface-timer_rs);
send_router_advert(iface-timer_rs);
}

In the file dhcpv6-ia.c line 64 the socket parameter is checked
reconf_event.socket = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC |
TFD_NONBLOCK);
if (reconf_event.socket  0) {
syslog(LOG_ERR, Failed to create timer: %s, strerror(errno));
return -1;
}


Hans
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [6relayd] Crash when timerfd_create is not enabled

2013-06-19 Thread Steven Barth
Thanks for the hint. It is fixed upstream now. I will update the OpenWrt 
revision when some more bugs pile up.



Cheers,

Stevem
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel