From a52e28c7dd4bce1a0a9374f8860bda6d5784b1b0 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Mon, 2 Feb 2009 11:02:19 +0000 Subject: [PATCH] Explain that we assume AF_INET and only use the addr and port field from a struct sockaddr_in, so there is no need to initialize sin_len --- sbin/ipfw/ipfw2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 0a2790bd5c17..c0dfac31a395 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2733,7 +2733,10 @@ ipfw_add(int ac, char *av[]) action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); - p->sa.sin_len = sizeof(struct sockaddr_in); + /* + * In the kernel we assume AF_INET and use only + * sin_port and sin_addr. + */ p->sa.sin_family = AF_INET; p->sa.sin_port = 0; /*