Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2007 10:00:18 GMT
From:      linimon@lonesome.com (Mark Linimon)
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/111129: [patch] ports/net/ifstated
Message-ID:  <200704021000.l32A0IvR047496@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/111129; it has been noted by GNATS.

From: linimon@lonesome.com (Mark Linimon)
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/111129: [patch] ports/net/ifstated
Date: Mon, 2 Apr 2007 04:50:40 -0500

 Forwarding patch from email directly to me.
 
 On Mon, Apr 02, 2007 at 01:20:55PM +0400, Artemiev Igor wrote:
 > 
 > -- 
 > iprefetch ai
 
 > --- ifstated.c.orig	Mon Apr  2 11:38:09 2007
 > +++ ifstated.c	Mon Apr  2 11:44:01 2007
 > @@ -49,6 +49,8 @@
 >  
 >  #include "ifstated.h"
 >  
 > +#define MAX_TIMERS 100
 > +
 >  struct	 ifsd_config *conf = NULL, *newconf = NULL;
 >  
 >  int	 opts = 0;
 > @@ -168,7 +170,7 @@
 >  		rt_handler = kev.udata;
 >  		rt_handler(kev.ident);
 >  	      }
 > -	    else if ((kev.filter == EVFILT_TIMER) && (kev.ident == IFSD_EVTIMER_EXTERNAL))
 > +	    else if ((kev.filter == EVFILT_TIMER) && ((kev.ident - IFSD_EVTIMER_EXTERNAL) < MAX_TIMERS))
 >  	      {
 >  		external_async_exec((struct ifsd_external *)kev.udata);
 >  	      }
 > @@ -374,6 +376,7 @@
 >  	struct ifsd_external *external;
 >  	struct timespec ts;
 >  	int freq;
 > +	int imod = 0;
 >  
 >  	ts.tv_nsec = 0;
 >  	ts.tv_sec = 0;
 > @@ -389,8 +392,10 @@
 >  
 >  				/* schedule it for later */
 >  				freq = (external->frequency * 1000);
 > -				EV_SET(&kev, IFSD_EVTIMER_EXTERNAL, EVFILT_TIMER, EV_ADD, 0, freq, (void *)external);
 > +				EV_SET(&kev, IFSD_EVTIMER_EXTERNAL + imod, EVFILT_TIMER, EV_ADD, 0, freq, (void *)external);
 >  				kevent(kq, &kev, 1, NULL, 0, &ts);
 > +				imod ++;
 > +				if(imod >= MAX_TIMERS) imod = 0;
 >  			}
 >  			break;
 >  		case IFSD_EVTIMER_DEL:
 > @@ -401,7 +406,9 @@
 >  					external->pid = 0;
 >  				}
 >  				freq = (external->frequency * 1000);
 > -				EV_SET(&kev, IFSD_EVTIMER_EXTERNAL, EVFILT_TIMER, EV_DELETE, 0, freq, (void *)external);
 > +				EV_SET(&kev, IFSD_EVTIMER_EXTERNAL + imod, EVFILT_TIMER, EV_DELETE, 0, freq, (void *)external);
 > +				imod ++;
 > +				if(imod < MAX_TIMERS) 
 >  				kevent(kq, &kev, 1, NULL, 0, &ts);
 >  			}
 >  			break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704021000.l32A0IvR047496>