On Fri, Nov 16, 2018 at 07:33:47PM +0100, Florian Obser wrote: > On Fri, Nov 16, 2018 at 04:30:28PM +0100, Reyk Floeter wrote: > > Hi, > > > > the following patch prevents rad(8) from aborting when an interface is > > detached (or a clone destroyed). It is no fatal condition for rad as > > it otherwise handles interface events just fine by reinitializing > > itself on interface route messages. One additional style bit included. > > > > OK? > > I think we should just remove the error handling, like this: > > - if (setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, > - &all_routers, sizeof(all_routers)) == -1) > - fatal("IPV6_LEAVE_GROUP(%s)", ra_iface->name); > + setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &all_routers, > + sizeof(all_routers)); > > It's somewhere on my todo list to go through rad(8) and slaacd(8) and > check each fatal if we realy want to crash. I think here we should > just plow along. > > Either way, OK florian@ >
Thanks, I did it like you suggested and committed it. Reyk > > > > Reyk > > > > Index: frontend.c > > =================================================================== > > RCS file: /cvs/src/usr.sbin/rad/frontend.c,v > > retrieving revision 1.16 > > diff -u -p -u -p -r1.16 frontend.c > > --- frontend.c 15 Aug 2018 16:48:20 -0000 1.16 > > +++ frontend.c 16 Nov 2018 15:22:35 -0000 > > @@ -648,12 +648,13 @@ leave_all_routers_mcast_group(struct ra_ > > log_debug("leaving multicast group on %s", ra_iface->name); > > all_routers.ipv6mr_interface = ra_iface->if_index; > > if (setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, > > - &all_routers, sizeof(all_routers)) == -1) > > + &all_routers, sizeof(all_routers)) == -1 && errno != ENXIO) > > fatal("IPV6_LEAVE_GROUP(%s)", ra_iface->name); > > } > > > > struct ra_iface* > > -find_ra_iface_by_id(uint32_t if_index) { > > +find_ra_iface_by_id(uint32_t if_index) > > +{ > > struct ra_iface *ra_iface; > > > > TAILQ_FOREACH(ra_iface, &ra_interfaces, entry) { > > -- > I'm not entirely sure you are real.