diff options
author | Renato Botelho <garga@FreeBSD.org> | 2021-05-04 09:10:43 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2021-05-04 09:18:48 -0300 |
commit | 712ed31c3e42950d96d5995007d7a7b361cd3d83 (patch) | |
tree | e9ccfb3ef29147e3e7c9e253bed93bb74d252f90 /security/expiretable/files/patch-ioctl__helpers.c | |
parent | multimedia/gmmlib: update to 21.1.3 (diff) |
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")
Diffstat (limited to 'security/expiretable/files/patch-ioctl__helpers.c')
-rw-r--r-- | security/expiretable/files/patch-ioctl__helpers.c | 49 |
1 files changed, 49 insertions, 0 deletions
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); +-} |