NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/49462: if_slowtimo callout mangled?



The following reply was made to PR kern/49462; it has been noted by GNATS.

From: Masao Uebayashi <uebayasi%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: Martin Husemann <martin%duskware.de@localhost>
Subject: Re: kern/49462: if_slowtimo callout mangled?
Date: Thu, 11 Dec 2014 23:54:27 +0900

 I would do this, to close possible race window, by dereference ifp->if_slowtimo
 only once:
 
 void
 if_slowtimo(void *arg)
 {
 	void (*slowtimo)(void *);
 	int s;
 
 	slowtimo = ifp->if_slowtimo;
 	if (slowtimo == NULL)
 		return;
 	s = splnet();
 	if (ifp->if_timer != 0 && --ifp->if_timer == 0)
 		(*slowtimo)(ifp);
 	splx(s);
 	callout_schedule(ifp->if_slowtimo_ch, hz / IFNET_SLOWHZ);
 }
 


Home | Main Index | Thread Index | Old Index