1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

security/expiretable: Fix build on 13+

get_states() is the reason it stopped building on FreeBSD 13 and newer.
Retire this function since it's not used anywhere and get the build
fixed.

PR:		253547
Reported by:	mike@sentex.net
Reviewed by:	kp
Approved by:	maintainer timeout (2 weeks)
Obtained from:	pfSense
MFH:		2021Q2
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Renato Botelho 2021-05-04 09:10:43 -03:00
parent 68df3e7b9e
commit 712ed31c3e
5 changed files with 65 additions and 7 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= expiretable
PORTVERSION= 0.6
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://expiretable.fnord.se/

View File

@ -1,6 +1,6 @@
--- Makefile.orig 2006-01-11 11:09:05.000000000 -0200
+++ Makefile 2014-03-27 15:31:34.000000000 -0300
@@ -21,8 +21,8 @@
--- Makefile.orig 2006-01-11 13:09:05 UTC
+++ Makefile
@@ -21,8 +21,8 @@ MAN=expiretable.1
all: ${TARGET}
install: ${TARGET}

View File

@ -1,6 +1,6 @@
--- expiretable.c.orig 2013-01-23 11:56:08.000000000 +0100
+++ expiretable.c 2013-01-23 11:56:26.000000000 +0100
@@ -290,6 +290,7 @@
--- expiretable.c.orig 2006-01-18 22:47:01 UTC
+++ expiretable.c
@@ -290,6 +290,7 @@ main(int argc, char *const *argv) {
for (i = 0; i < astats_count; i++) {
if (astats[i].pfras_tzero <= min_timestamp) {
del_addrs_list[del_addrs_count] = astats[i].pfras_a;

View File

@ -0,0 +1,49 @@
--- ioctl_helpers.c.orig 2021-04-19 18:12:17 UTC
+++ ioctl_helpers.c
@@ -160,46 +160,3 @@ radix_get_tstats(int dev, struct pfr_tstats **tstats,
*tstats = (struct pfr_tstats *)pt.pfrio_buffer;
return pt.pfrio_size;
}
-
-
-int
-get_states(int dev, struct pf_state **states) {
- struct pfioc_states ps;
- caddr_t inbuf, newinbuf;
- size_t len = 0;
-
- inbuf = newinbuf = NULL;
- memset(&ps, 0, sizeof(struct pfioc_states));
- *states = NULL;
- for (;;) {
- ps.ps_len = len;
- if (len) {
- newinbuf = realloc(inbuf, len);
- if (newinbuf == NULL) {
- if (inbuf != NULL) {
- free(inbuf);
- inbuf = newinbuf = NULL;
- return (-1);
- }
- }
- ps.ps_buf = inbuf = newinbuf;
- }
- if (ioctl(dev, DIOCGETSTATES, &ps) < 0) {
- if (inbuf != NULL) {
- free(inbuf);
- inbuf = newinbuf = NULL;
- }
- return (-1);
- }
- if (ps.ps_len + sizeof(struct pfioc_states) < len)
- break; /* We have states! */
- if (ps.ps_len == 0)
- return (0); /* No states available */
- if (len == 0)
- len = ps.ps_len;
- len *= 2;
- }
-
- *states = ps.ps_states;
- return ps.ps_len / sizeof(struct pf_state);
-}

View File

@ -0,0 +1,9 @@
--- ioctl_helpers.h.orig 2021-04-19 18:12:20 UTC
+++ ioctl_helpers.h
@@ -31,6 +31,5 @@ int radix_get_tstats(int dev, struct pfr_tstats **tsta
int radix_get_tables(int dev, struct pfr_table **tables, const struct pfr_table *filter, int flags);
int radix_get_addrs(int dev, const struct pfr_table *table, struct pfr_addr **addrs, int flags);
int radix_del_addrs(int dev, const struct pfr_table *table, struct pfr_addr *addrs, int addr_count, int flags);
-int get_states(int dev, struct pf_state **states);
#endif /*_IOCTL_HELPERS_H_*/