From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 13 00:00:55 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF33E16A4CE for ; Mon, 13 Sep 2004 00:00:55 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEE5E43D48 for ; Mon, 13 Sep 2004 00:00:55 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8D00tgM050327 for ; Mon, 13 Sep 2004 00:00:55 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8D00tTh050323; Mon, 13 Sep 2004 00:00:55 GMT (envelope-from gnats) Date: Mon, 13 Sep 2004 00:00:55 GMT Message-Id: <200409130000.i8D00tTh050323@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Max Laier Subject: Re: kern/71652: rdr@pf doesnt work properly with fastforwarding X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Max Laier List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 00:00:56 -0000 The following reply was made to PR kern/71652; it has been noted by GNATS. From: Max Laier To: freebsd-gnats-submit@FreeBSD.org, xdivac02@stud.fit.vutbr.cz Cc: Subject: Re: kern/71652: rdr@pf doesnt work properly with fastforwarding Date: Mon, 13 Sep 2004 01:56:42 +0200 --Boundary-00=_8IORB59XSICYAUR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline This is caused by a superfluous byte order change in ip_fastfwd.c while the comment in ip_input.c clearly states what is expected: /* * ip_fastforward firewall changed dest to local. * We expect ip_len and ip_off in host byte order. */ Diff attached and on: http://people.freebsd.org/~mlaier/FASTFWD_OURS.byteorder.diff -- Max --Boundary-00=_8IORB59XSICYAUR Content-Type: text/x-diff; charset="us-ascii"; name="FASTFWD_OURS.byteorder.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="FASTFWD_OURS.byteorder.diff" Index: ip_fastfwd.c =================================================================== RCS file: /usr/store/mlaier/fcvs/src/sys/netinet/ip_fastfwd.c,v retrieving revision 1.19 diff -u -r1.19 ip_fastfwd.c --- ip_fastfwd.c 27 Aug 2004 15:32:28 -0000 1.19 +++ ip_fastfwd.c 12 Sep 2004 23:50:34 -0000 @@ -465,16 +465,15 @@ if (in_localip(dest) || m->m_flags & M_FASTFWD_OURS) { #endif /* IPFIREWALL_FORWARD */ forwardlocal: - /* for ip_input */ - m->m_flags |= M_FASTFWD_OURS; - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); - /* * Return packet for processing by ip_input() + * Keep host byte order as excepted at ip_input's + * "ours"-label */ + m->m_flags |= M_FASTFWD_OURS; if (ro.ro_rt) RTFREE(ro.ro_rt); + return 0; } /* --Boundary-00=_8IORB59XSICYAUR--