On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki <[email protected]> wrote:
> - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff
IFNET_RENTER();
IFNET_FOREACH() {
if->if_watchdog();
}
IFNET_REXIT();
This is not safe; if_watchdog() may resend packets, too slow operation
to do in critical section.
I think you need to allocate a global array if_watchdog_t
**if_slowtimo_watchdog, like ifindex2ifnet, which grows and can store
pointers of if_watchdog of all interfaces, and do:
IFNET_RENTER();
i = 0;
IFNET_FOREACH() {
if_slowtimo_watchdog[i++] = if->if_watchdog;
}
IFNET_REXIT();
for (j = 0; j < i; j++) {
(*(if_slowtimo_watchdog[j]))();
}