Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 May 2021 12:23:09 GMT
From:      Renato Botelho <garga@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 1cb655c9ea50 - 2021Q2 - security/expiretable: Fix build on 13+
Message-ID:  <202105041223.144CN9JG020890@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q2 has been updated by garga:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1cb655c9ea5096eed0093ac1d1a09020c6efc6c7

commit 1cb655c9ea5096eed0093ac1d1a09020c6efc6c7
Author:     Renato Botelho <garga@FreeBSD.org>
AuthorDate: 2021-05-04 12:10:43 +0000
Commit:     Renato Botelho <garga@FreeBSD.org>
CommitDate: 2021-05-04 12:22:43 +0000

    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")
    
    (cherry picked from commit 712ed31c3e42950d96d5995007d7a7b361cd3d83)
---
 security/expiretable/Makefile                      |  2 +-
 security/expiretable/files/patch-Makefile          |  6 +--
 .../{patch-expiretable => patch-expiretable.c}     |  6 +--
 security/expiretable/files/patch-ioctl__helpers.c  | 49 ++++++++++++++++++++++
 security/expiretable/files/patch-ioctl__helpers.h  |  9 ++++
 5 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/security/expiretable/Makefile b/security/expiretable/Makefile
index 8b45159aff94..01bf8fe88aa4 100644
--- a/security/expiretable/Makefile
+++ b/security/expiretable/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	expiretable
 PORTVERSION=	0.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security
 MASTER_SITES=	http://expiretable.fnord.se/
 
diff --git a/security/expiretable/files/patch-Makefile b/security/expiretable/files/patch-Makefile
index 0706126107b4..c6923d4b732b 100644
--- a/security/expiretable/files/patch-Makefile
+++ b/security/expiretable/files/patch-Makefile
@@ -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}
diff --git a/security/expiretable/files/patch-expiretable b/security/expiretable/files/patch-expiretable.c
similarity index 64%
rename from security/expiretable/files/patch-expiretable
rename to security/expiretable/files/patch-expiretable.c
index 9083b0d12b14..e2a86b4e7ce3 100644
--- a/security/expiretable/files/patch-expiretable
+++ b/security/expiretable/files/patch-expiretable.c
@@ -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;
diff --git a/security/expiretable/files/patch-ioctl__helpers.c b/security/expiretable/files/patch-ioctl__helpers.c
new file mode 100644
index 000000000000..077ebe5ca6b7
--- /dev/null
+++ b/security/expiretable/files/patch-ioctl__helpers.c
@@ -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);
+-}
diff --git a/security/expiretable/files/patch-ioctl__helpers.h b/security/expiretable/files/patch-ioctl__helpers.h
new file mode 100644
index 000000000000..1179a82ec9c0
--- /dev/null
+++ b/security/expiretable/files/patch-ioctl__helpers.h
@@ -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_*/



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