Bug 111129 - [patch] net/ifstated
Summary: [patch] net/ifstated
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-02 09:20 UTC by Artemiev Igor
Modified: 2007-04-14 15:10 UTC (History)
1 user (show)

See Also:


Attachments
ifstated-3_7.patch (10.13 KB, patch)
2007-04-13 21:47 UTC, Steven Kreuzer
no flags Details | Diff
file.dat (1.03 KB, text/plain; charset=US-ASCII; delsp=yes; format=flowed)
2007-04-13 21:47 UTC, Steven Kreuzer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artemiev Igor 2007-04-02 09:20:04 UTC
opensky = "("ping -q -c 3 -S 10.128.61.124 -t 3 www.ru > /dev/null" every 10 || "ping -q -c 3 -S 10.128.61.124 -t 3 www7.yandex.ru > /dev/null" every 10)"      
ifstated: initial state: opensky_up                                             
ifstated: changing state to opensky_up                                          
ifstated: running ping -q -c 3 -S 10.128.61.124 -t 3 www.ru > /dev/null         
ifstated: running ping -q -c 3 -S 10.128.61.124 -t 3 www7.yandex.ru > /dev/null 
ifstated: running logger -t opensky 'Channel going up'                          
ifstated: running ping -q -c 3 -S 10.128.61.124 -t 3 www7.yandex.ru > /dev/null 
ifstated: running ping -q -c 3 -S 10.128.61.124 -t 3 www7.yandex.ru > /dev/null

If to set multiple check criteria, the latest will be used only

Fix: 

Patch attached
How-To-Repeat:     Try with multiple criteria.
    Launch as ifstated -vv -d
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-04-02 09:43:36 UTC
State Changed
From-To: open->feedback

To which port does this apply?  Your Synopsis field is blank. 

Also, no patch was attached.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2007-04-02 10:47:16 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 3 Mark Linimon 2007-04-02 10:50:40 UTC
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;
Comment 4 Stefan Walter freebsd_committer freebsd_triage 2007-04-05 13:17:06 UTC
Dear maintainer of net/ifstated,

a problem report has been submitted describing a problem with this port.
You can read the content of this PR including a patch at [1]. Any input
regarding the problem/patch would be greatly appreciated.

Regards,
Stefan

[1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/111129
Comment 5 Stefan Walter freebsd_committer freebsd_triage 2007-04-05 13:17:15 UTC
State Changed
From-To: open->feedback

Awaiting maintainer's feedback.
Comment 6 Stefan Walter freebsd_committer freebsd_triage 2007-04-09 08:08:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Take.
Comment 7 Stefan Walter freebsd_committer freebsd_triage 2007-04-09 08:18:05 UTC
[Cc'ing the FreeBSD GNATS submission address to have your (quoted) mail in
the audit trail of the PR.]

Steven Kreuzer, 09.04.07, 01:42h CEST:

> I applied the patch and got it to compile. So far, it looks good, but  
> i am gonna need a little more time to review the patch.
> 
> In addition, this patch comes at a weird time because I am currently  
> working on updating the port with the code from OpenBSD 4.1
> I was planning on changing the version of the port from the date to  
> the version of OpenBSD that it was pulled from.
> 
> I will send you a patch that will update the Makefile (It will be  
> changed to 3.5 i think since that is the version the code is from)  
> and will also update files/
> patch-ifstated.c with the patch that is attached to the PR.
> 
> Just wanted to drop you a line to let you know I am working on this,  
> Hopefully I can have something to you by the end of the week.


OK, let me know when something can be committed.

Regards,
Stefan
Comment 8 Steven Kreuzer 2007-04-13 21:46:45 UTC
On Apr 9, 2007, at 3:18 AM, Stefan Walter wrote:

> [Cc'ing the FreeBSD GNATS submission address to have your (quoted)  
> mail in
> the audit trail of the PR.]
>
> Steven Kreuzer, 09.04.07, 01:42h CEST:
>
>> I applied the patch and got it to compile. So far, it looks good, but
>> i am gonna need a little more time to review the patch.
>>
>> In addition, this patch comes at a weird time because I am currently
>> working on updating the port with the code from OpenBSD 4.1
>> I was planning on changing the version of the port from the date to
>> the version of OpenBSD that it was pulled from.
>>
>> I will send you a patch that will update the Makefile (It will be
>> changed to 3.5 i think since that is the version the code is from)
>> and will also update files/
>> patch-ifstated.c with the patch that is attached to the PR.
>>
>> Just wanted to drop you a line to let you know I am working on this,
>> Hopefully I can have something to you by the end of the week.
>
> OK, let me know when something can be committed.
>
> Regards,
> Stefan
Comment 9 Steven Kreuzer 2007-04-13 21:47:36 UTC
Attached is a patch making with the changes mentioned earlier.
Comment 10 dfilter service freebsd_committer freebsd_triage 2007-04-14 15:03:25 UTC
stefan      2007-04-14 14:03:19 UTC

  FreeBSD ports repository

  Modified files:
    net/ifstated         Makefile distinfo pkg-descr 
    net/ifstated/files   patch-ifstated.c 
  Log:
  - Update to 3.7. [1]
  - Integrate patch that fixes behaviour with multiple check criteria. [2]
  
  PR:             111129 [1], [2]
  Submitted by:   maintainer [1]
                  Artemiev Igor <ai@bmc.brk.ru> [2]
  Approved by:    maintainer
  
  Revision  Changes    Path
  1.6       +5 -2      ports/net/ifstated/Makefile
  1.4       +3 -3      ports/net/ifstated/distinfo
  1.3       +62 -50    ports/net/ifstated/files/patch-ifstated.c
  1.2       +3 -3      ports/net/ifstated/pkg-descr
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 11 Stefan Walter freebsd_committer freebsd_triage 2007-04-14 15:03:38 UTC
State Changed
From-To: feedback->closed

Update to new version, which integrates the submitted patch, has been committed, 
thanks!