aboutsummaryrefslogtreecommitdiffstats
path: root/net/ifstated
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2014-12-24 13:59:32 +0800
committerkevlo <kevlo@FreeBSD.org>2014-12-24 13:59:32 +0800
commitd1c004c289ff21226ddf3c58979799c23a0c8dad (patch)
treeb9d016de6225ee330117eeddb4624dd47769b2b8 /net/ifstated
parent1bb48c2c4c679facc6991f63884db2d9edab8aea (diff)
downloadfreebsd-ports-gnome-d1c004c289ff21226ddf3c58979799c23a0c8dad.tar.gz
freebsd-ports-gnome-d1c004c289ff21226ddf3c58979799c23a0c8dad.tar.zst
freebsd-ports-gnome-d1c004c289ff21226ddf3c58979799c23a0c8dad.zip
Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this.
Diffstat (limited to 'net/ifstated')
-rw-r--r--net/ifstated/Makefile2
-rw-r--r--net/ifstated/files/patch-ifstated.c31
-rw-r--r--net/ifstated/files/patch-log.c13
3 files changed, 36 insertions, 10 deletions
diff --git a/net/ifstated/Makefile b/net/ifstated/Makefile
index 23a692f3010d..9086b7423762 100644
--- a/net/ifstated/Makefile
+++ b/net/ifstated/Makefile
@@ -3,7 +3,7 @@
PORTNAME= ifstated
PORTVERSION= 5.1
-PORTEPOCH= 2
+PORTEPOCH= 3
CATEGORIES= net
MASTER_SITES= http://christianserving.org/ports/net/ifstated/
diff --git a/net/ifstated/files/patch-ifstated.c b/net/ifstated/files/patch-ifstated.c
index 2f55d7c94194..eddf934f2c7e 100644
--- a/net/ifstated/files/patch-ifstated.c
+++ b/net/ifstated/files/patch-ifstated.c
@@ -1,5 +1,5 @@
---- ifstated.c.orig 2011-07-03 23:34:14.000000000 -0500
-+++ ifstated.c 2012-03-23 14:32:56.412119431 -0500
+--- ifstated.c.orig 2011-07-04 12:34:14.000000000 +0800
++++ ifstated.c 2014-12-05 15:10:34.000000000 +0800
@@ -26,9 +26,11 @@
#include <sys/time.h>
#include <sys/ioctl.h>
@@ -104,7 +104,16 @@
event_set(&rt_msg_ev, rt_fd, EV_READ|EV_PERSIST, rt_msg_handler, NULL);
event_add(&rt_msg_ev, NULL);
-@@ -403,6 +424,7 @@
+@@ -396,13 +417,15 @@
+ waitpid(external->pid, &s, 0);
+ external->pid = 0;
+ }
+- evtimer_del(&external->ev);
++ if (event_initialized(&external->ev))
++ evtimer_del(&external->ev);
+ }
+ break;
+ }
}
}
@@ -112,7 +121,17 @@
#define LINK_STATE_IS_DOWN(_s) (!LINK_STATE_IS_UP((_s)))
int
-@@ -580,6 +602,44 @@
+@@ -534,7 +557,8 @@
+ if (conf->nextstate != NULL && conf->curstate != conf->nextstate) {
+ log_info("changing state to %s", conf->nextstate->name);
+ if (conf->curstate != NULL) {
+- evtimer_del(&conf->curstate->ev);
++ if (event_initialized (&conf->curstate->ev))
++ evtimer_del(&conf->curstate->ev);
+ external_evtimer_setup(conf->curstate,
+ IFSD_EVTIMER_DEL);
+ }
+@@ -580,6 +604,44 @@
}
}
@@ -157,7 +176,7 @@
/*
* Fetch the current link states.
*/
-@@ -589,26 +649,31 @@
+@@ -589,26 +651,31 @@
struct ifaddrs *ifap, *ifa;
char *oname = NULL;
int sock = socket(AF_INET, SOCK_DGRAM, 0);
@@ -197,7 +216,7 @@
}
freeifaddrs(ifap);
close(sock);
-@@ -703,3 +768,13 @@
+@@ -703,3 +770,13 @@
}
free(expression);
}
diff --git a/net/ifstated/files/patch-log.c b/net/ifstated/files/patch-log.c
index a5d7528b0e5c..e50da5213858 100644
--- a/net/ifstated/files/patch-log.c
+++ b/net/ifstated/files/patch-log.c
@@ -1,6 +1,13 @@
---- log.c.orig 2010-06-11 13:29:09.127347360 -0500
-+++ log.c 2010-06-11 13:29:20.636464838 -0500
-@@ -28,8 +28,8 @@
+--- log.c.orig 2007-10-25 14:03:31.000000000 +0800
++++ log.c 2014-12-05 15:11:31.000000000 +0800
+@@ -22,14 +22,15 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#include <time.h>
+
+ void log_init(int);
+ void log_warn(const char *, ...);
void log_warnx(const char *, ...);
void log_info(const char *, ...);
void log_debug(const char *, ...);