summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2003-09-04 15:57:37 +0000
committertmm <tmm@FreeBSD.org>2003-09-04 15:57:37 +0000
commitc8c49c9053cf93bca10de6b9c511e6405c9e181b (patch)
tree474ac6419aa4ea18b63da48e013ad1ab9fd3c01e /sbin/ipfw
parent9c26b457bca07cc9d6b5462fec7d92fe3df4cd6b (diff)
downloadFreeBSD-src-c8c49c9053cf93bca10de6b9c511e6405c9e181b.zip
FreeBSD-src-c8c49c9053cf93bca10de6b9c511e6405c9e181b.tar.gz
Apply a bandaid to get this working on sparc64 again; the introduction
of do_cmd() broke things, because this function assumes that a socklen_t is large enough to hold a pointer. A real solution to this problem would be a rewrite of do_cmd() to treat the optlen parameter consistently and not use it to carry a pointer or integer dependent on the context.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index bec3c2a..c8a0301 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -363,7 +363,7 @@ align_uint64(uint64_t *pll) {
* conditionally runs the command.
*/
static int
-do_cmd(int optname, void *optval, socklen_t optlen)
+do_cmd(int optname, void *optval, uintptr_t optlen)
{
static int s = -1; /* the socket */
int i;
@@ -1556,7 +1556,7 @@ sets_handler(int ac, char *av[])
nbytes = sizeof(struct ip_fw);
if ((data = calloc(1, nbytes)) == NULL)
err(EX_OSERR, "calloc");
- if (do_cmd(IP_FW_GET, data, (socklen_t)&nbytes) < 0)
+ if (do_cmd(IP_FW_GET, data, (uintptr_t)&nbytes) < 0)
err(EX_OSERR, "getsockopt(IP_FW_GET)");
bcopy(&((struct ip_fw *)data)->next_rule,
&set_disable, sizeof(set_disable));
@@ -1701,7 +1701,7 @@ list(int ac, char *av[], int show_counters)
nbytes = nalloc;
if ((data = realloc(data, nbytes)) == NULL)
err(EX_OSERR, "realloc");
- if (do_cmd(ocmd, data, (socklen_t)&nbytes) < 0)
+ if (do_cmd(ocmd, data, (uintptr_t)&nbytes) < 0)
err(EX_OSERR, "getsockopt(IP_%s_GET)",
do_pipe ? "DUMMYNET" : "FW");
}
@@ -3493,7 +3493,7 @@ done:
rule->cmd_len = (uint32_t *)dst - (uint32_t *)(rule->cmd);
i = (char *)dst - (char *)rule;
- if (do_cmd(IP_FW_ADD, rule, (socklen_t)&i) == -1)
+ if (do_cmd(IP_FW_ADD, rule, (uintptr_t)&i) == -1)
err(EX_UNAVAILABLE, "getsockopt(%s)", "IP_FW_ADD");
if (!do_quiet)
show_ipfw(rule, 0, 0);
OpenPOWER on IntegriCloud