diff options
author | luigi <luigi@FreeBSD.org> | 2009-12-06 18:04:26 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2009-12-06 18:04:26 +0000 |
commit | d0b8e66dba0af5ad71faace968e40cfdac06caa0 (patch) | |
tree | 39cd72307d80ef94815ed51b1cd708ca66c84b68 /sbin | |
parent | e7512f1da4f773ff605a1d9e11378ac1de8717a5 (diff) | |
download | FreeBSD-src-d0b8e66dba0af5ad71faace968e40cfdac06caa0.zip FreeBSD-src-d0b8e66dba0af5ad71faace968e40cfdac06caa0.tar.gz |
restore setting of sin_len (was removed in 1.146 last february) as
it seems that now it is necessary for 'forward' to work outside lo0.
The bug (and fix) was reported on 8.0. This patch probably applies
to RELENG_7 as well.
It seems that 'pf' has a similar bug.
Submitted by: Lytochkin Boris
MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 58094a1..7edfbd5 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2740,9 +2740,11 @@ chkarg: /* * In the kernel we assume AF_INET and use only - * sin_port and sin_addr. + * sin_port and sin_addr. Remember to set sin_len as + * the routing code seems to use it too. */ p->sa.sin_family = AF_INET; + p->sa.sin_len = sizeof(struct sockaddr_in); p->sa.sin_port = 0; /* * locate the address-port separator (':' or ',') |