From ai@bmc.brk.ru Mon Apr 2 08:12:54 2007 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B731B16A403 for ; Mon, 2 Apr 2007 08:12:54 +0000 (UTC) (envelope-from ai@bmc.brk.ru) Received: from stalker.bmc.brk.ru (bmc.brk.ru [89.249.50.58]) by mx1.freebsd.org (Postfix) with ESMTP id 6E17313C43E for ; Mon, 2 Apr 2007 08:12:54 +0000 (UTC) (envelope-from ai@bmc.brk.ru) Message-Id: <200704020757.l327vJ5T069290@bmc-gw.bmc.brk.ru> Date: Mon, 2 Apr 2007 11:57:19 +0400 (MSD) From: Artemiev Igor Reply-To: Artemiev Igor To: FreeBSD-gnats-submit@freebsd.org Cc: skreuzer@f2o.org Subject: [patch] X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 111129 >Category: ports >Synopsis: [patch] net/ifstated >Confidential: no >Severity: serious >Priority: medium >Responsible: stefan >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 02 08:20:04 GMT 2007 >Closed-Date: Sat Apr 14 14:05:06 GMT 2007 >Last-Modified: Sat Apr 14 14:10:00 GMT 2007 >Originator: Artemiev Igor >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: BMC >Environment: System: FreeBSD bmc-gw.bmc.brk.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #7: Sat Dec 9 15:59:55 MSK 2006 root@bmc-gw.bmc.brk.ru:/usr/obj/usr/src/sys/bmc-gw.kernel i386 >Description: 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 >How-To-Repeat: Try with multiple criteria. Launch as ifstated -vv -d >Fix: Patch attached >Release-Note: >Audit-Trail: State-Changed-From-To: open->feedback State-Changed-By: linimon State-Changed-When: Mon Apr 2 08:43:36 UTC 2007 State-Changed-Why: To which port does this apply? Your Synopsis field is blank. Also, no patch was attached. http://www.freebsd.org/cgi/query-pr.cgi?pr=111129 State-Changed-From-To: feedback->open State-Changed-By: linimon State-Changed-When: Mon Apr 2 09:47:16 UTC 2007 State-Changed-Why: Feedback received. http://www.freebsd.org/cgi/query-pr.cgi?pr=111129 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; State-Changed-From-To: open->feedback State-Changed-By: stefan State-Changed-When: Thu Apr 5 12:17:15 UTC 2007 State-Changed-Why: Awaiting maintainer's feedback. http://www.freebsd.org/cgi/query-pr.cgi?pr=111129 From: Stefan Walter To: skreuzer@f2o.org Cc: GNATS Subject: Re: ports/111129: [patch] net/ifstated Date: Thu, 5 Apr 2007 14:17:06 +0200 --dgjlcl3Tl+kb3YDk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --dgjlcl3Tl+kb3YDk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iQGVAwUBRhTowVaRERsSueCzAQKXGAv/dXeBAL3L6cUUJS/VNkO5dVaBdfNgXudC AyblQS57ord8vkiPYIcbLtTVb0DB+6UKQCSWcdl18VYHLtoVOeCSGUZXcwLvK0Wm v8z9GZZwz9RO3h9JtoPs6guUbzIt9uUxII1njjwDAEl5h3Te9JSIGDMPKw7l6nPo ku5G3m7Kd42DXFuq3neYnS+gNVJYVOgfDJZhs/52ZghA/fltSySwLV/HMamOrU7E tGYyl2CIEcwxVMAlX+MCrtg+MmxDB4CIga9BW3eHk2hfcXTXw8TU4nu3azZAljkH 69bP7YRe7MT5qV88IcgbKF+bC2D2dPBxw/HPc5E/UnjjSZwpIcr2Txf7azrQbulF VgICHUk64LTUaAdXAKIfDpIQvHMQjp1aI+9Jd37/Xg0az3E0EdeiA2HYRKD+b92M +0cyk5yZkpUe/p9lBL13LyfHlFZtDjhzGUulAzEFLOngh+Z7jhNVuwM4DgCoK8B3 eKd3BOyD3xTXNjBYfD/Hk1YnzNKQpvCL =MASd -----END PGP SIGNATURE----- --dgjlcl3Tl+kb3YDk-- Responsible-Changed-From-To: freebsd-ports-bugs->stefan Responsible-Changed-By: stefan Responsible-Changed-When: Mon Apr 9 07:08:02 UTC 2007 Responsible-Changed-Why: Take. http://www.freebsd.org/cgi/query-pr.cgi?pr=111129 From: Stefan Walter To: Steven Kreuzer Cc: GNATS Subject: Re: ports/111129: [patch] net/ifstated Date: Mon, 9 Apr 2007 09:18:05 +0200 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [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 =20 > i am gonna need a little more time to review the patch. >=20 > In addition, this patch comes at a weird time because I am currently =20 > 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 =20 > the version of OpenBSD that it was pulled from. >=20 > I will send you a patch that will update the Makefile (It will be =20 > changed to 3.5 i think since that is the version the code is from) =20 > and will also update files/ > patch-ifstated.c with the patch that is attached to the PR. >=20 > Just wanted to drop you a line to let you know I am working on this, =20 > Hopefully I can have something to you by the end of the week. OK, let me know when something can be committed. Regards, Stefan --T4sUOijqQbZv57TR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iQGVAwUBRhnorFaRERsSueCzAQJp2gv+Nm3qUESQtMT1VTz2YHQ1lrpn/a1nHSSR Vlin0v0gi5jsNcg12VbhZGYKMROJ/yGKeQVwvPWg7LQQgzueQx3QVPRzm/jzpxoM q99sG/iiu2R4UAwelseVYr8prBt/O7h+jqV8yKHmiz/qZlebyObhlGMGpwvPwGWp 9Y1TK67fUmJm1RTu2N/eKW+CB8s64x7yboWPZ7w1eH4S6qqleIpwtW6Xn5U+f+4U lJ/JWOkgKUqdyUXTFdFoy1BSSuS+xukFeoVDTYtj6ZFQA3uAa8Qc6ZcqRFuaTr1h uYWqrBG22qKYXu7VTZ4yR5gw2luDTZOVgqQRU3V9gv+ksdqPT1Uj5pVRrR5//V0K SOk0pXOqO+DLy5SKITCjarzU1WYyoa8RYZEZoBxjXn8nOfROhEUuRbTgE9iXMW2J dSKxVaO5arWzX61xOEBdGZQuzyOu5BytvXQxMhgtItxApP2cjpfZqL075VDScL1C EJulkIUgXiSmZTYByw7oNIA4KpfVOIoY =EyZO -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR-- From: Steven Kreuzer To: Stefan Walter Cc: GNATS Subject: Re: ports/111129: [patch] net/ifstated Date: Fri, 13 Apr 2007 16:46:45 -0400 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 From: Steven Kreuzer To: Stefan Walter Cc: GNATS Subject: Re: ports/111129: [patch] net/ifstated Date: Fri, 13 Apr 2007 16:47:36 -0400 --Apple-Mail-1-621560559 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Attached is a patch making with the changes mentioned earlier. --Apple-Mail-1-621560559 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=ifstated-3_7.patch Content-Disposition: attachment; filename=ifstated-3_7.patch Index: Makefile =================================================================== RCS file: /usr/share/cvs/freebsd/ports/net/ifstated/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- Makefile 9 Jan 2007 21:48:36 -0000 1.5 +++ Makefile 6 Apr 2007 19:05:34 -0000 @@ -6,9 +6,12 @@ # PORTNAME= ifstated -PORTVERSION= 20050505 +PORTVERSION= 3.7 +PORTEPOCH= 1 CATEGORIES= net -MASTER_SITES= http://skreuzer.f2o.org/mirror/ifstated/ +MASTER_SITES= http://skreuzer.f2o.org/mirror/ifstated/ \ + http://www.atarininja.org/~wxs/distfiles/ \ + http://www.pkix.net/mirror/f2o.org/ifstated/ MAINTAINER= skreuzer@f2o.org COMMENT= Interface State daemon Index: distinfo =================================================================== RCS file: /usr/share/cvs/freebsd/ports/net/ifstated/distinfo,v retrieving revision 1.3 diff -u -r1.3 distinfo --- distinfo 22 Jan 2006 21:23:08 -0000 1.3 +++ distinfo 6 Apr 2007 13:13:22 -0000 @@ -1,3 +1,3 @@ -MD5 (ifstated-20050505.tar.gz) = 33faa596ababdc1133fbea840827b52a -SHA256 (ifstated-20050505.tar.gz) = 3c34b5e59154b6a9dc521ee31f753c4f0c5631973e0633dbbe6ebdf101dda41e -SIZE (ifstated-20050505.tar.gz) = 12341 +MD5 (ifstated-3.7.tar.gz) = 3c399ea13e546c9bbf2ba5e844b5728b +SHA256 (ifstated-3.7.tar.gz) = e4bdd5d53c13daa4fa8936165c5522fe22c4a63a3c59c2c965ccc423aa91deaf +SIZE (ifstated-3.7.tar.gz) = 12374 Index: pkg-descr =================================================================== RCS file: /usr/share/cvs/freebsd/ports/net/ifstated/pkg-descr,v retrieving revision 1.1 diff -u -r1.1 pkg-descr --- pkg-descr 21 Nov 2004 03:08:36 -0000 1.1 +++ pkg-descr 6 Apr 2007 13:46:19 -0000 @@ -1,5 +1,7 @@ -This is a port of ifstated(8) from OpenBSD. From the manpage: +This is a port of ifstated(8) from OpenBSD by Matthew George. + +From the manpage: *** The ifstated daemon runs commands in response to network state changes, @@ -11,5 +13,3 @@ *** It has been modified to use FreeBSD's kqueue/kevent mechanism and sysctl. - -Matthew George Index: files/patch-ifstated.c =================================================================== RCS file: /usr/share/cvs/freebsd/ports/net/ifstated/files/patch-ifstated.c,v retrieving revision 1.2 diff -u -r1.2 patch-ifstated.c --- files/patch-ifstated.c 6 May 2005 17:39:09 -0000 1.2 +++ files/patch-ifstated.c 6 Apr 2007 13:05:46 -0000 @@ -1,14 +1,14 @@ ---- ../ifstated-20050505.orig/ifstated.c Thu May 5 11:51:24 2005 -+++ ifstated.c Thu May 5 12:06:07 2005 +--- ifstated.c-orig Fri Apr 6 09:04:30 2007 ++++ ifstated.c Fri Apr 6 09:05:30 2007 @@ -1,4 +1,5 @@ /* $OpenBSD: ifstated.c,v 1.21 2005/02/07 12:38:44 mcbride Exp $ */ +/* $Id: ifstated.c,v 1.3 2005/05/05 16:06:07 mdg Exp $ */ - + /* * Copyright (c) 2004 Marco Pfatschbacher @@ -23,12 +24,15 @@ */ - + #include +#include #include @@ -16,12 +16,12 @@ #include #include +#include - + #include +#include #include #include - + @@ -38,8 +42,6 @@ #include #include @@ -31,7 +31,14 @@ #include #include #include -@@ -52,15 +54,15 @@ +@@ -47,20 +49,22 @@ + + #include "ifstated.h" + ++#define MAX_TIMERS 100 ++ + struct ifsd_config *conf = NULL, *newconf = NULL; + int opts = 0; int opt_debug = 0; int opt_inhibit = 0; @@ -40,7 +47,7 @@ +char *configfile = "%%PREFIX%%/etc/ifstated.conf"; +int kq; +struct kevent kev; - + -void startup_handler(int, short, void *); -void sighup_handler(int, short, void *); +void startup_handler(void); @@ -53,33 +60,33 @@ void external_async_exec(struct ifsd_external *); void check_external_status(struct ifsd_state *); void external_evtimer_setup(struct ifsd_state *, int); -@@ -75,6 +77,8 @@ +@@ -75,6 +79,8 @@ void remove_expression(struct ifsd_expression *, struct ifsd_state *); void log_init(int); void logit(int, const char *, ...); +int get_ifcount(void); +int get_ifmib_general(int, struct ifmibdata *); - + void usage(void) -@@ -89,7 +93,7 @@ +@@ -89,7 +95,7 @@ int main(int argc, char *argv[]) { - struct timeval tv; + struct timespec ts; int ch; - + while ((ch = getopt(argc, argv, "dD:f:hniv")) != -1) { -@@ -136,26 +140,54 @@ +@@ -136,26 +142,54 @@ setproctitle(NULL); } - + - event_init(); + kq = kqueue(); + log_init(opt_debug); - + - signal_set(&sigchld_ev, SIGCHLD, sigchld_handler, &sigchld_ev); - signal_add(&sigchld_ev, NULL); + ts.tv_sec = 0; @@ -87,13 +94,13 @@ + + EV_SET(&kev, SIGCHLD, EVFILT_SIGNAL, EV_ADD, 0, 0, (void *)sigchld_handler); + kevent(kq, &kev, 1, NULL, 0, &ts); - + /* Loading the config needs to happen in the event loop */ - tv.tv_usec = 0; - tv.tv_sec = 0; - evtimer_set(&startup_ev, startup_handler, &startup_ev); - evtimer_add(&startup_ev, &tv); - + - event_loop(0); + EV_SET(&kev, IFSD_EVTIMER_STARTUP, EVFILT_TIMER, EV_ADD|EV_ONESHOT, 0, 0, (void *)startup_handler); + kevent(kq, &kev, 1, NULL, 0, &ts); @@ -111,7 +118,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); + } @@ -125,55 +132,55 @@ + /* NOTREACHED */ exit(0); } - + void -startup_handler(int fd, short event, void *arg) +startup_handler() { int rt_fd; + struct timespec ts; - + if (load_config() != 0) { logit(IFSD_LOG_NORMAL, "unable to load config"); -@@ -165,18 +197,20 @@ +@@ -165,18 +199,20 @@ if ((rt_fd = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) err(1, "no routing socket"); - + - event_set(&rt_msg_ev, rt_fd, EV_READ|EV_PERSIST, - rt_msg_handler, &rt_msg_ev); - event_add(&rt_msg_ev, NULL); + ts.tv_sec = 0; + ts.tv_nsec = 0; - -- signal_set(&sighup_ev, SIGHUP, sighup_handler, &sighup_ev); -- signal_add(&sighup_ev, NULL); ++ + EV_SET(&kev, rt_fd, EVFILT_READ, EV_ADD, 0, 0, (void *)rt_msg_handler); + kevent(kq, &kev, 1, NULL, 0, &ts); -+ + +- signal_set(&sighup_ev, SIGHUP, sighup_handler, &sighup_ev); +- signal_add(&sighup_ev, NULL); + EV_SET(&kev, SIGHUP, EVFILT_SIGNAL, EV_ADD, 0, 0, (void *)sighup_handler); + kevent(kq, &kev, 1, NULL, 0, &ts); - + logit(IFSD_LOG_NORMAL, "started"); } - + void -sighup_handler(int fd, short event, void *arg) +sighup_handler() { logit(IFSD_LOG_NORMAL, "reloading config"); if (load_config() != 0) -@@ -207,7 +241,7 @@ +@@ -207,7 +243,7 @@ } - + void -rt_msg_handler(int fd, short event, void *arg) +rt_msg_handler(int fd) { char msg[2048]; struct rt_msghdr *rtm = (struct rt_msghdr *)&msg; -@@ -245,22 +279,6 @@ +@@ -245,22 +281,6 @@ } - + void -external_handler(int fd, short event, void *arg) -{ @@ -194,26 +201,27 @@ external_async_exec(struct ifsd_external *external) { char *argp[] = {"sh", "-c", NULL, NULL}; -@@ -354,23 +372,25 @@ +@@ -354,23 +374,28 @@ external_evtimer_setup(struct ifsd_state *state, int action) { struct ifsd_external *external; + struct timespec ts; + int freq; ++ int imod = 0; + + ts.tv_nsec = 0; + ts.tv_sec = 0; - + if (state != NULL) { switch (action) { case IFSD_EVTIMER_ADD: TAILQ_FOREACH(external, &state->external_tests, entries) { - struct timeval tv; - + /* run it once right away */ external_async_exec(external); - + /* schedule it for later */ - tv.tv_usec = 0; - tv.tv_sec = external->frequency; @@ -221,23 +229,27 @@ - external); - evtimer_add(&external->ev, &tv); + 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: -@@ -380,7 +400,9 @@ +@@ -380,7 +405,11 @@ kill(external->pid, SIGKILL); external->pid = 0; } - evtimer_del(&external->ev); + 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; } -@@ -504,7 +526,6 @@ +@@ -504,7 +533,6 @@ logit(IFSD_LOG_NORMAL, "changing state to %s", conf->nextstate->name); if (conf->curstate != NULL) { @@ -245,10 +257,10 @@ external_evtimer_setup(conf->curstate, IFSD_EVTIMER_DEL); } -@@ -550,6 +571,48 @@ +@@ -550,6 +578,48 @@ } } - + + +int +get_ifcount(void) @@ -294,27 +306,27 @@ /* * Fetch the current link states. */ -@@ -559,29 +622,34 @@ +@@ -559,29 +629,34 @@ struct ifaddrs *ifap, *ifa; char *oname = NULL; int sock = socket(AF_INET, SOCK_DGRAM, 0); + int ifcount = get_ifcount(); + int i; - + - if (getifaddrs(&ifap) != 0) + if (getifaddrs(&ifap) != 0 || ifcount == -1) err(1, "getifaddrs"); - + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - struct ifreq ifr; - struct if_data ifrdat; + struct ifmibdata ifmd; + struct if_data ifdata; - + if (oname && !strcmp(oname, ifa->ifa_name)) continue; oname = ifa->ifa_name; - + - strlcpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name)); - ifr.ifr_data = (caddr_t)&ifrdat; + for (i = 1; i <= ifcount; i++) @@ -323,11 +335,11 @@ + if (! strcmp(ifmd.ifmd_name, oname)) + break; + } - + - if (ioctl(sock, SIOCGIFDATA, (caddr_t)&ifr) == -1) - continue; + ifdata = ifmd.ifmd_data; - + scan_ifstate(if_nametoindex(ifa->ifa_name), - ifrdat.ifi_link_state, &conf->always); + ifdata.ifi_link_state, &conf->always); @@ -338,7 +350,7 @@ } freeifaddrs(ifap); close(sock); -@@ -663,7 +731,6 @@ +@@ -663,7 +738,6 @@ TAILQ_REMOVE(&state->external_tests, expression->u.external, entries); free(expression->u.external->command); --Apple-Mail-1-621560559 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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 --Apple-Mail-1-621560559-- State-Changed-From-To: feedback->closed State-Changed-By: stefan State-Changed-When: Sat Apr 14 14:03:38 UTC 2007 State-Changed-Why: Update to new version, which integrates the submitted patch, has been committed, thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=111129 From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/111129: commit references a PR Date: Sat, 14 Apr 2007 14:03:25 +0000 (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 [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" >Unformatted: